CIS 1033 - Fundamentals of Programming

Bob Comer, Professor, CIS/CSC


Chapter 3 Homework
Due Wednesday, June 9

Click here for answers.

  1. When should program documentation be done?
  2. Why does your program need to be easily readable by humans?
  3. How can you make your program more readable?
  4. What is the difference between a directive (such as #include) and a program statement?
  5. What object is used in your program to represent the computer keyboard?
  6. What operator is used n C++ to perform input?
  7. What is a prompt message? Give an example.
  8. When you type input from the keyboard, what are the best characters to use to delimit values in the input?
  9. When C++ is reading a numeric value from the keyboard, what marks (delimits) the end of the number?
  10. When the user is typing input from the keyboard, when is the input available to the program?
  11. What is an output manipulator, and where is it used?
  12. How long does an output manipulator's effect last?
  13. Write C++ statements to input a value from the keyboard and store it in variable distance. Be sure to include a prompt message for the user.
  14. Write a C++ statement or statements to print the string "The distance to Grandma's house is" followed by the value of variable distance followed by the string "miles.". Be sure that none of the values runs together.
  15. Write a C++ statement or statements to print the string "% Interest Rate: " followed by the value of float variable rate. Include code to ensure that rate prints with exactly 1 decimal place.
  16. Write a C++ statement that will change the output justification to left justified.
  17. Write a C++ statement that will print the string "shuttle" right justified in 10 columns.
  18. What will the following statement print?
    cout << setw(4) << "Hello";
  19. What will the following statement print?
    cout << setw(4) << 10 << endl << 10;


Return to Fundamentals Home Page

URL: http://www.austin.cc.tx.us/comer/cis1033/
Copyright: Ó 1999 by the Austin Community College
Department of Computer Studies. All rights reserved.
Comments to: Bob Comer
Last updated: June2, 1999

Austin Community College is an equal opportunity educator and employer.