Lab 0

Due 11:59pm January 24.

Moodle Link

0) Do the programming projects 6 and 7 on page 37. Use the program in Display 1.8 (source code available Here). Do this for yourself, do NOT turn in.

1) (20 pts) Write a C++ program that reads in two integers and then outputs both their sum and their product. One way to proceed is to start with the program in Display 1.8 and to then modify that program to produce the program for this project. Be certain to type the first line of your program exactly the same as the first line in Display 1.8. In particular, be sure that the first line begins at the left-hand end of the line with no space before or after the # symbol. Also, be certain to add the symbols \n to the last output statement in your program. For example, the last output statement might be the following:

cout << "This is the end of the program.\n";

2) (20 pts) Write a program that allows the user to enter a number of quarters, dimes, and nickels and then outputs the monetary value of the coins in cents. For example, if the user enters 2 for the number of quarters, 3 for the number of dimes, and 1 for the number of nickels, then the program should output that the coins are worth 85 cents.

Submit the following to Moodle
  1. The main.cpp file from each project
  2. A text or word file with a copy and paste of the runs of the programs at least three times with different values.
Submit the your program on Moodle by midnight, September 1.

Grading Rubric

Requirement Grading Comments PointsSorted descending Score
Total   40  
Program 1 correct output   8  
Program 2 correct output   8  
Program 1 Input prompts   6  
Program 1 output format   6  
Program 2 Input prompts   6  
Program 2 output format   6  

Topic attachments
I Attachment History Action Size Date Who Comment
Microsoft Word filedocx Lab_0_Test_Runs_Coin_and_Integer0.docx r1 manage 75.9 K 2016-09-02 - 01:51 UnknownUser my cpp files and word document with trial runs
C source code filecpp Sum_and_Product.cpp r1 manage 0.7 K 2016-09-01 - 22:10 SpaldingVance  
Microsoft Word filedocx Untitleddocument-6.docx r1 manage 4.8 K 2016-09-01 - 22:16 SpaldingVance  
C source code filecpp coin.cpp r1 manage 1.1 K 2016-09-02 - 01:55 UnknownUser my cpp files and word document with trial runs
C source code filecpp coins.cpp r1 manage 0.8 K 2016-09-01 - 22:17 SpaldingVance  
C source code filecpp main.cpp r1 manage 0.7 K 2016-09-02 - 01:55 UnknownUser my cpp files and word document with trial runs

This topic: SCMP118/Fall2016 > WebHome > Lab0
Topic revision: r13 - 2017-01-17 - JimSkon
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback