Review problems for CS 16 Exam 1 How do "machine languages" and "high-level languages" differ? What does a compiler do? What is the meaning of the term "software life cycle"? What is an algorithm? Give the rules for identifiers (variable names) in C++ programs. Show examples of invalid identifiers, with explanations for why they are not valid. What is the difference between int and double data types? Briefly explain how character data (specifically the C++ char type) are stored in memory. Include an example using the ASCII coding scheme. What is the difference between char and string data types? What are all the relational operators (to compare two values for equality, inequality or magnitude)? What are the boolean operators (for combining boolean expressions)? Complete the following table (known as a "truth table") by writing either True or False on each blank line. For example, the first blank asks for the result of (A && B) when A is True and B is True. A B A && B A || B True True _________ _________ True False _________ _________ False True _________ _________ False False _________ _________ Let grade be a char variable, and let score be an int variable that has already been assigned a value. Write an if/else structure that sets grade to: 'A' if score is greater than or equal to 90, 'B' if score is at least 80 but less than 90, 'C' if score is at least 70 but less than 80, 'D' if score is at least 60 but less than 70, or 'F' if score is less than 60. Write a loop to find the sum of all integers from m through n. For example, if m is 4 and n is 7, this sum is 4+5+6+7 = 22. You may assume that m will always be less than or equal to n. Translate your solution to the last problem into a different type of loop. For example, if your solution uses a while loop, then translate it into a do/while or for loop. Summarize the meaning of each of the following terms, in your own words. Modularity Abstraction, in the context of modularity Reusability What is the purpose of a function prototype? Write a prototype for a function named process that takes one int argument and returns a double value. Write a whole C function named greatest that takes three int arguments, and returns the greatest of the three values. Remember there is no built-in function max in the C++ language, but you may write one as a helper function if you want. Write an expression that will set the double variable x to a random value between -2.0 and +2.0, inclusive. double x = ********************************** That's enough for Lab04 Step 2, but probably not enough to fully prepare you for the first exam. The best way to do that is to do selected "Self-Test Exercises" from the textbook. Exam 1 will cover Chapters 1, 2, 3, 4 and 5.