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

a. Any call started between 8:00 am and 6:00pm Monday through Friday is billed of a rate of $ 0.40 per minute.
b. Any call starting before 8:00 am after 6:00 pm Monday through Friday is charge at a rate of $0.25 per minute.
c. Any call started on Saturday or Sunday is charge of a rate of $ 0.15 per minute.


The input will consist 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 inputted in 24-hour notation, so the time 1:30 pm is input as 13:30 pm.

The day of the week will be read as one of the following pairs of the character value, which are stored in two variables of the type char.

Mo, Tu, We, Th, Fr, Sa, Su.

Be sure to allow the user to use either uppercase or lowercase letter or combination of the two.

The number of minutes will be input as a whole number of minutes. Your program should include a loop that lets the user repeat this calculation. Program, produce a variant on this program that reads the information for all the phone calls in one week from a file and then writes a phone bill of call as well as the total bill for all the calls. List the phone call in the output file in the same order as they appear in the input file.


Input:

• Day of the week
• Starting time of the call
• Length of the call in minutes

Recommended Answers

All 2 Replies

Member Avatar for JSPMA1988

That sounds like a fun problem to solve. Thanks for giving me something to do in my spare time. Or did you need some help with your code that you've already written?

Spent 2 years at Microcell programming this on cellular phone.
I'll be glad to help you with any problem you will encounter.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.