CS201 In Class Exercise-ch4 f2007 solution

CS201 In Class - Chapter 4(In class solution/= Tracing a Young b Young/= Tracing a Bingo b Correct/= Tracing a Total is 37 b Total is 4/= Tracing a

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 4 (In class solution) //============================== Tracing #1 ============================= a. Young b. Young //============================== Tracing #2 ============================= a. Bingo!! b. Correct!! c. Bingo!! //============================== Tracing #3 ============================= a. Total is 37 b. Total is 4 c. Total is 37 //============================== Tracing #4 ============================= a. Orange 12 b. Peach 8 c. Apple 14 d. Peach 10 //============================== Program #1 ============================= int main() { const double TIPRATE = .15; double check, tip; cout << "Enter the check amount: "; cin >> check; tip = check * TIPRATE; if (tip <= 1.00) tip = 1.00; cout << "The tip amount is: $" << tip << endl; return 0; } //============================== Program #2 ============================= int main() { string name; cout << " Who is the chairperson of the computer science department ? "; getline (cin, name); if (name == “Dr. Larry Dunning” || name ==
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/18/2008 for the course CS 201 taught by Professor Conway during the Fall '07 term at Bowling Green.

Page1 / 2

CS201 In Class - Chapter 4(In class solution/= Tracing a Young b Young/= Tracing a Bingo b Correct/= Tracing a Total is 37 b Total is 4/= Tracing a

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online