C++ coding multiple choice exam
Questions 1 – 5 are True/False. Mark A for True and B for False. 1. In C++, the variables total and ToTaL are NOT considered to be the same variable. A) True B) False 2. The body of a while loop is only executed if the loop condition is false. A) True B) False 3. Pseudocode is considered a “high level” programming language. A) True B) False 4. An expression containing the operator && is true only if both its operands are true. A) True B) False 5. else if statements are tested sequentially until a match occurs. A) True B) False Questions 6 – 15 are Multiple Choice and worth 1 point each. 6. Which of the following is a valid constant declaration? A) const FRED int = 5; B) int const FRED = 5; C) int FRED const = 5; D) const int FRED = 5; E) FRED const int = 5; 7. const, while, if, and int are examples of: A) reserved (key) words B) identifiers C) variables D) compiler directives E) program comments 8. Which of the following is a valid C++ assignment statement? A) x = q – (y * z); B) y + z = x; C) y = b * c D) x = (x + (y z); E) x = a b; 9. The formula: can be represented in C++ as: A) x = a – b / c – d; B) x = a – b / (c – d); C) x = (a – b) / (c – d); D) x = (a – b) / c – d; E) (a – b) / (c – d) = x; 10. Which of the following is a valid variable name? A) 2ndName B) %Last_Name C) year03 D) @Month E) #55 11. Which library must be included to enable keyboard input? A) iomanip B) cstdlib C) input D) iostream E) kbdin 12. Which of the following is an invalid variable name? A) Part time B) part_time C) full_time_job D) FullTime E) _Parttime 13. Which library must be included to enable formatted output? A) output B) scrnout C) format D) cstdlib E) iomanip 14. Which of the following is an invalid variable name? A) _64 B) 64_ C) Sum_ D) _S_u_m_ E) _Sum 15. What is the comment section at the beginning of a program that gives information about the author and the program called? A) prologue B) prelude C) heading...