Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions

Question

What is the preferred personality?

Answered: 1 week ago

Question

What is the relationship between humans?

Answered: 1 week ago