Quiz 1

CS17

20 pts., Feb. 16

  1. What are reserved words? Also, give an example of one.

    Reserved words are words which have a pre-defined meaning with the language. Examples include if, while, int, and const.

    cout isn't a reserved word as far as C++ is concerned; it is a function provided by the iostream library. print is not a reserved word in C++.

  2. What is a constant? Also, give an example of one.

    A constant is an unchanging value. For instance: 12, 1.2E6, or 'a'. A symbolic constant is a variable defined with the const keyword. For instance:

    const double PI = 3.14159;
    

  3. Consider the following C++ statement:
    cout << "City tax is " << city_tax << " dollars.";
    
    What pseudocode instruction would correspond to this?

    print cityTax



Thomas P. Kelliher
Tue Feb 20 20:59:03 EST 1996
Tom Kelliher