Final Exam


  1. What is a computer program?

  2. What is a programming language?

  3. What is a function?

  4. How many main functions should a C++ program have?

  5. What is a standard library file?

  6. What is the purpose of an include directive?

  7. What does a preprocessor do?

  8. What does a compiler do?

  9. What does a linker do?

  10. Which of the following types of memory is not temporary: cache memory, RAM, or persistent storage?

  11. What is the amount of information that may be stored at a particular memory address?

  12. Is the size of a data type always the same no matter which computer you may be working on?

  13. What is the difference between an unsigned and a signed data type?

  14. What is an ASCII value?

  15. What is a literal string?

  16. What is an expression?

  17. What is the effect of declaring a variable?

  18. Can you refer to a variable before declaring it as long as you declare it later?

  19. What is the difference between the address and sizeof operators?

  20. What is the difference between initialization and assignment?

  21. What is overflow?

  22. Do you use the cin object for compile-time or run-time assignment of values to variables ?

  23. Which of the four arithmetic operations has more than one operator?

  24. Which of the arithmetic operators cannot have a floating-point operand?

  25. Which of the arithmetic operators cannot have a zero as a second operand?

  26. Assuming total is an integer variable, how else could you express in code total = total + 5?

  27. What is the result of 4 + 3 * 2?

  28. What is the result of the expression 8 / 2 * 4?

  29. What is the result of the expression 15 / 4?

  30. What operator or function do you use to raise a number to a certain power?

  31. What is an algorithm?

  32. How many operands are in a relational expression?

  33. What is the data type of the expression following the if keyword?

  34. In an if / else if / else statement, which part must you have one, but only one, of?

  35. In an if / else if / else statement, which part may you have more than one of?

  36. In an if / else if / else statement, which part may you omit?

  37. In a switch statement, what is the required data type of expression following the switch keyword?

  38. In a switch statement, may the expression following a case keyword be a variable?

  39. Which keyword in a switch statement corresponds to the else keyword in an if / else if / else statement?

  40. Can you use nested if statements as an alternative to the logical And and Or operators?

  41. For which of the logical operators do both Boolean expressions have to be true for the overall Boolean expression to be true?

  42. For which of the logical operators do both Boolean expressions have to be false for the overall Boolean expression to be false?

  43. Which of the logical operators reverses the truth of a Boolean expression, making a true expression false and a false expression true?

  44. What does the increment operator do?

  45. What does the decrement operator do?

  46. In the statement cout << --num, which occurs first, decrementing num or the outputting of the value of num?

  47. What is an iteration?

  48. What is the usual purpose of the first expression in the parentheses following the for keyword?

  49. What is the purpose of the second expression in the parentheses following the for keyword?

  50. What is the usual purpose of the third expression in the parentheses following the for keyword?

  51. Can one or more of the expressions in the parentheses following the for keyword be empty?

  52. What is the purpose of the break keyword in a for loop?

  53. What is the purpose of the continue keyword in a for loop?

  54. If you were going to use nested for loops to print rows and columns, which for loop would print the columns inner or outer?

  55. Which of the three loopsfor, while, or do whileexecutes at least once?

  56. Which of the three loopsfor, while, or do whileis the best choice when the number of iterations is predictable?

  57. Is the parenthetical expression following the while keyword for initialization, condition, or update?

  58. What is a flag?

  59. What is the difference between variable scope and lifetime?

  60. Must a function other than main be prototyped?

  61. Is a function required to have at least one argument?

  62. May a function have more than one argument?

  63. What is the effect on a variable in main if it is passed by value to another function that changes the argument corresponding to that variable?

  64. What is the effect on a variable in main if it is passed by reference to another function that changes the argument corresponding to that variable?

  65. Must a function have a return value?

  66. May a function have more than one return value?

  67. May a function have neither a return value nor any arguments?

  68. May a function have both a return value and arguments?

  69. Can a particular array contain integers, floats, and characters ?

  70. What is the number of the starting index of an array?

  71. What is the number of the ending index of an array?

  72. What are the two alternative methods of initializing an array?

  73. What is the purpose of the null character in a character array?

  74. What is the value of the name of an array?

  75. When you pass an array name as a function argument, are you passing it by value, reference, or address?

  76. What is a pointer?

  77. What is the difference between declaring an integer variable and declaring an integer pointer variable?

  78. What is the meaning of the data type in the declaration of a pointer?

  79. What is the meaning and purpose of NULL when being assigned to a pointer?

  80. What operator do you use to assign a pointer the address of another variable or constant?

  81. What is the purpose of the indirection operator?

  82. What is the effect of incrementing a pointer variable?

  83. What are the purposes of the new and delete operators?

  84. Can you use an assignment operator to assign the value of one C-string to another?

  85. What does it mean for data to be persistent?

  86. What is a file?

  87. What standard library should you include when your program reads from, or writes to, files?

  88. Which of the three objects, fstream, ifstream , or ofstream , may be used both for file input and file output?

  89. What are the two functions you can use to open a file?

  90. What is the purpose of opening a file?

  91. What is the purpose of closing a file?

  92. What is a constructor?

  93. Should file stream objects be passed as function arguments by value or by reference?

  94. What type of relationship is involved in inheritance?

  95. What type of relationship is involved in containership?

  96. What is a structure?

  97. What are the two ways to initialize a structure?

  98. Can you nest one structure within another structure?

  99. Why may a structure be passed by reference even if the function will not change the value of its member variables?

  100. What is an important difference between a structure and a class?




C++ Demystified(c) A Self-Teaching Guide
C++ Demystified(c) A Self-Teaching Guide
ISBN: 72253703
EAN: N/A
Year: 2006
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net