CMPSC 101 CMPSC101 Exam 1 Solutions (Penn State University)

CMPSC 101 CMPSC101 Exam 1 Solutions (Penn State University)

soffix

  • $34.99


CMPSC 101 CMPSC101 Exam 1 Answers (Penn State University)

  1. The programs that run on a computer are referred to as _______. 
  2. A computer has a(n)_______. 
  3. The only programming language that a computer can directly understand is its own 
  4. Object­oriented programming focuses on things (nouns) rather than actions (verbs). 
  5. C++ source code files typically have the extension _______. 
  6. The compiler is a program that translates a high­level language program into machine code. 
  7. In Visual Studio .NET, every application can have _______ solution(s) and can have _______ project(s). 
  8. Every C++ program must have a function named 'main'. 
  9. The C++ compiler considers the identifier 'CanofWorms' to be the same as the identifier 'canofworms' . 
  10. The _______ file must be included, using the #include statement, for any application that outputs data to the screen or inputs data from the keyboard using C++­style stream input/output. 
  11. _______ must end the body of every function. 
  12. Comments _______.
  13. The _______ character terminates a statement. 
  14. Identifiers _______.
  15. Assume that input is defined as a variable of type int. Which of the following statements gives the value entered at the keyboard to input? 
  16. When the computer executes a statement that reads values from the keyboard using cin, _______. 
  17. The _______ character is not a C++ operator. 
  18. A variable definition must specify a name and a data type. 
  19. Any fractional part of an integer division result is _______. 
  20. When a breakpoint is set at a particular statement _______.
  21. An algorithm specifies the ________. 
  22. The _______ operator returns true when the right operand is greater than or equal to the left operand. 
  23. Which of the following if else statements displays the message Passed! if int variable grade is greater than or equal to 60? 
  24. A constant is defined using the key word 'constant'. 
  25. Floating­point values are represented using the _______ primitive type. 
  26. _______ is not an assignment operator. 
  27. If int variable x contains the value 17, what will x contain after the expression x %= 3 is executed? 
  28. Stream manipulator _______ indicates that floating­point values should be output in fixed­point format. 
  29. When stream manipulators fixed and setprecision( 5 ) are placed in the output stream, what is displayed when the expression cout << 1234.567 is executed? 
  30. A char is a(n) _______; a string is a(n) _______. 
  31. Assume that input is a string. If the user types “John Smith” and presses Enter when the expression cin >> input executes, what would input contain?. 
  32. To which operator does the truth table in Fig. 5.1 correspond? 
  33. The condition ( ( expression1 ) && ( ! expression2 ) ) evaluates to true when _______. 
  34. The expression !( number == 10 ) always evaluates to the same result as (number != 10). 
  35. The while statement’s body executes only if the loop­continuation condition is false. 
  36. The loop while ( x <= 10 ) terminates _______. 
  37. What is the purpose of a table header? 
  38. An infinite loop occurs when a loop­continuation condition in a do while never becomes false. 
  39. If its loop­continuation condition is false the first time it is evaluated, a do...while repetition statement _______. 
  40. If delta and gamma are int variables, where delta=20 and gamma=15, what value is stored into gamma by the following statement? 
  41. A variable whose value can be either true or false has a data type of: 
  42. Which one of the following would be an illegal variable name 
  43. Which of the following is the list of the six C++ relational operators? 
  44. The ______ operator always follows the cin object, and the ______ operator follows the cout object. 
  45. After execution of the following code, what will be the value of 'angle' if the input value is 10? 
  46. In a C++ program, two slash marks ( // ) indicate: 

                                                  We Also Recommend


                                                  Sale

                                                  Unavailable

                                                  Sold Out