Question: Please solve in java. The phone company used the following rate structure for calls from San Francisco to Miami, Florida back in 1995: Any call

Please solve in java.

The phone company used the following rate structure for calls from San Francisco to Miami, Florida back in 1995:

  • Any call started at or after 6:00 pm (1800) but before 8:00 am (800.) is discounted 50%.
  • All calls are subject to a 4% federal tax.
  • The regular rate is $0.40 per minute.
  • Any call longer than 60 minutes receives a 15% discount on its cost (after any other discount is subtracted but before tax is added).

Please do not ask me in which order the calculations are to be done. That information can be deduced from the final bullet point above.

Write a program that reads from the user the start time for a call based on a 24-hour clock and the length of the call in minutes. Both of these will be stored in int variables. The gross cost (before any discount or tax) should be printed, and then the net cost (after discounts and taxes). Turn in 4 outputs for this exercise, showing that your program works in each of the following 4 cases. Use the input examples shown here, don't make up your own.

Sample output 1:

 Enter start time: 2322 Enter length of call in minutes: 67 gross cost: $26.80 net cost: $11.85 

Sample output 2:

 Enter start time: 759 Enter length of call in minutes: 10 gross cost: $4.00 net cost: $2.08 

Sample output 3:

 Enter start time: 1300 Enter length of call in minutes: 100 gross cost: $40.00 net cost: $35.36 

Sample output 4:

 Enter start time: 1300 Enter length of call in minutes: 10 gross cost: $4.00 net cost: $4.16 

Turn in your source code and four outputs, one matching each of the four sample outputs given above, all in a single file, as usual.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!