CIS 1033 - Fundamentals of Programming
Bob Comer, Professor, CIS/CSC
Chapter 2 Homework
Due Wednesday, June 9
Click here for answers.
- How do we write comments in a C++ program?
- What does the cout object represent?
- What is a string? How do we write a literal string constant in C++?
- Write a literal string constant for your name.
- Write a character constant for the first letter of the alphabet.
- What does a variable declaration tell the C++ compiler?
- What does a named constant declaration tell the compiler?
- Write a declaration for a variable called side1 that can hold a number with a fractional part.
- Write a declaration for a constant called STAMP_PRICE that has a value of .33.
- What are the advantages of using named constants over using literal constants in a program?
- How do precedence and associativity differ?
- How do we change the normal order of operations?
- True or False: a division operation will always give a floating point result.
- What happens when an assignment statement attempts to store a number with a fractional part in an integer variable?
- Write a C++ statement that multiplies variable numCouples by 2 and stores the result in a variable called numPeople.
- 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.