Post-lab - Lab (3)


Computing the cost of a phone call


Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedule:

      a) Any call started between 8:00AM and 6:00PM, Monday through Friday, is billed at a rate of $.40 per minute.

      b) Any call started before 8:00AM or after 6:00PM, Monday through Friday, is billed at a rate of $.25 per minute.

      c) Any call started on Satuday or Sunday is charged at a rate of $.15 per minute.

The input consists of the day of the week, the time the call started, and the length of the call in minutes. The output will be the cost of the call. The time is to be input in 24-hours notation, so time 1:30PM is input as 13:30.

The day of the week will be rad as one of the following pairs of character values, which are stored in two variables of type charci:

Mo   Tu   We   Th   Fr   Sa   Su

Be sure to allow the user to use either uppercase or lowercase letters or a combination of the two. The number of minutes will be input as a valu of type int. (You can assume that the user rounds the input to a whole number of minutes.) Your program should include a loop that lets the user repeat this calculation until the user says she or he is done.

Step 1) Develop your algorithm and test it on paper.  Design the algorithm in pseudocode or in flow-chart before writing the program. As any problem, there are several precautions that you need to take when you solve this problem.  I will let you figure them out, but they are out there and you need to watch for them.

Step 2) Implement the algorithm, write a C++ program, called phonecall.cpp, and test it to make sure it produces the correct results.

Instructions to return your lab to the teacher: (5 points penalty if instructions are not followed appropriately)

  1. Be sure you return all the printed files where you have written all your answers. These are the answers to 31-1 and the post-lab.
  2. Transfer ONLY the source files you have written from loki to your local Windows machine and collect them in a  folder called YourLastNameLab3 (ex. AGuercioLab3). Be sure you did not copy any executable file in this folder. If you did, please remove it from the folder.
    The files to be zipped are:
    WarmUp.doc(x)
    Exercise 3-2: 
    ticket.cpp
    Exercise 3-3:
    ex33_2.cpp
    ex33_3.cpp
    Exercise 3-4:
    ex34_1.cpp
    Post Lab:
    phonecall.cpp
  3. Now exit from the folder, right click on the folder and choose WinZip--> Zip and e-mail. This action will pack your folder and attach it to an e-mail. You can use a Rar Program if you have that program instead of the Zip program.
  4. Send the e-mail to kschaffe@kent.edu with the subject CS23021 Lab 3 Submission.
  5. Send your e-mail before the deadline to receive full credit.
  6. ATTENTION: Return a printed copy of the source files to your instructor as well.

Congratulations! You have completed another Lab of CS I !! :-))