Write a program that computes the cost of a long distance call. The cost of the call is determined a

Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedules.
a. A call made between 8:00 AM and 6:00 PM is billed at a rate of 6 rupees per minute.
b. A call made before 8:00 AM or after 6:00 PM is charged at a rate of 3.75 rupees.
The input to the program will consist of the time the call started, and the length of call in minutes. The output will be the cost of call. The time is to be input in 24-hours notation, so the time 1:30 PM is input as 13:30. The time will be input using two variables of type int, one used for hour and other used for minutes. The number of the minutes for length of the call will also be input as a value of type int.
far2
Asked Mar 03, 2013
The Windows system has a Timer Function (not the timer object) that returns the number of seconds since the clock rolled over at midnight. 24 hours is 86,400, 08:00 A.M. is 28,600 and 18:00 is 64,800.

Record the timer value in a single precision variable when the call starts, If that value is greater than 28,600 and less than 64,800, set the RATE to 6 rupees, otherwise set it to 3.75.

When the call ends, record the ending timer value and subtract the starting timer value from the ending. Divide that value by 60 and multiply the difference by the rate. That value will be the cost of the call.
Rob
Answered Mar 03, 2013

TIP: If it's not your answer to this question, please click "Leave a Comment" button under the question to communicate with the question owner.

Categories