CIS 1033 - Fundamentals of Programming

Bob Comer, Professor, CIS/CSC


Chapter 2 Homework
Due Wednesday, June 9

Click here for answers.

  1. How do we write comments in a C++ program?
  2. What does the cout object represent?
  3. What is a string? How do we write a literal string constant in C++?
  4. Write a literal string constant for your name.
  5. Write a character constant for the first letter of the alphabet.
  6. What does a variable declaration tell the C++ compiler?
  7. What does a named constant declaration tell the compiler?
  8. Write a declaration for a variable called side1 that can hold a number with a fractional part.
  9. Write a declaration for a constant called STAMP_PRICE that has a value of .33.
  10. What are the advantages of using named constants over using literal constants in a program?
  11. How do precedence and associativity differ?
  12. How do we change the normal order of operations?
  13. True or False: a division operation will always give a floating point result.
  14. What happens when an assignment statement attempts to store a number with a fractional part in an integer variable?
  15. Write a C++ statement that multiplies variable numCouples by 2 and stores the result in a variable called numPeople.
  16. Write an output statement that prints the value of variable pkgWeight between the strings "The package weighs " and "pounds.".


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: May 25, 1999

Austin Community College is an equal opportunity educator and employer.