Name:_______________________________

 

Take-Home Quiz 1 for CSCI 201

(each question is worth 2 pts)

 

1. What is the largest base 10 number that you can represent in

32 bits using two’s complement?

 

2. How many bits are required to represent characters using the

ASCII character code.

 

3. Which of the following are legal C++ identifiers (names):

  1. GPA2
  2. int
  3. My-Cost
  4. $Cost
  5. No!

 

4. What does the following line of code do:


   cout << "Hello World!" << endl;

 

5. What would be printed by the following program?


   #include <iostream.h>

   int main() {
      int integer1 = 9;
      int integer2 = 5;
      cout << (integer1 / integer2) << endl;
   }

 

6. What would be printed by the following program?


   #include <iostream.h>

   int main() {
      int integer1;
      int integer2;
      cout << integer1 << integer2 << endl;
   }


7. Write a C++ statement that implements the following equation:

Q = (T1 * T2 / D - k) + T2


8. What are the names of the following operators:

  1. <
  2. %
  3. <<
  4. >>

 

9. What would be printed by the following program?


   #include <iostream.h>

   int main() {
      int myInt = 9;
      float myFloat= 5.5;
      cout << (myInt / myFloat) << endl;
   }

 

10. What does this expression evaluate to:

3*3+1%3