Morse Code Project 1
Morse Code Project 1
Morse Code Project 1
Students are expected to complete the practice programs before starting the
project.
Points 50
Instructors and teaching assistants have been available to assist with all
practice work. Students are now expected to complete this project without
Assistance
assistance from others (this includes receiving assistance from individuals
inside or outside of CPCC). Students should consider projects as non-
proctored exams. Please review the academic integrity policy on your
syllabus.
Please note: students can continue to receive assistance with practice work up
to 5:00 p.m. on the due date (review the late period on the syllabus).
Project Description In the 1850's, the hottest new technology was the telegraph. Messages or
telegrams could be sent via electrical forces traveling through a wire. Write a
program that will generate a bill for sending a telegram, accept payment and
instruct cashier how to give change. The amount owed is based on the number
of words sent. Customers are charged at a rate of $1.50 for blocks of 5 words
and $0.50 for single words. Your program should calculate the smallest charge
possible for the given amount of words sent. Named constants must be used in
the calculation.
Instructions:
1. Prompt user for the customers name, street address, city, state, zip code
and number of words sent.
2. Calculate and display a telegram bill with all information specified in the
Sample Output on page 2.
3. After displaying the telegram bill, prompt user for the amount of money
received from the customer. The user should supply the amount given in
pennies, for example 275 instead of 2.75.
4. Calculate the amount of change owed and display the number of dollars,
quarters, dimes, nickels, and pennies that the customer should receive.
1
6. Save your .cpp file using the Firstname_Lastname_Project1 naming
format. Upload in Moodle. Verify that your file actually uploaded.
7. Bonus Pts (5pts). After completing all instructions above, add code to
randomly generate the customers payment. That number should be an
integer. Use the number for the payment rather than the one received
from the user (overwrite the value stored in your payment variable with
the random number). Each time the program is run, a different random
number should be generated for the payment. You must follow all these
instructions to receive full credit.
Sample Output
Larry Smith
122 Main Street
Charlotte, NC 23499
Amount Owed: $47.50
Denomination Number
-------------- ---------------
Dollars 2
Quarters 2
Dimes 0
Nickels 0
Pennies 0
2
Grading Score Card: 50
User Interface Well User prompts provide adequate direction and have a
5
Designed professional, easy to read format.
TOTAL 50