Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task #2 Write Java program, with at least two modules or functions, that will modify the above program so it also calculates and displays the

Task #2 Write Java program, with at least two modules or functions, that will modify the above program so it also calculates and displays the amount of money Package A customers would save if they purchased Packages B or C, and the amount of money Package B customers would save if they purchased Package C. If there would be no savings, no message should be printed. This time the program should (1) use constants to represent the base rates and base hours, and (2) use DecimalFormat class to define format pattern and print total charges and total savings with $ in the front and two digits after decimal point with trailing zeros displayed.

The following are sample interactions that occur when running the program:

$ java InternetServiceProviderPart2

Enter the customer's package (A, B, or C): A

Enter the number of hours used: 10

The charges are $9.95

$ java InternetServiceProviderPart2

Enter the customer's package (A, B, or C): A

Enter the number of hours used: 20

The charges are $29.95

With package B you would have saved $16.00

With package C you would have saved $10.00

$ java InternetServiceProviderPart2

Enter the customer's package (A, B, or C): A

Enter the number of hours used: 30

The charges are $49.95

With package B you would have saved $26.00

With package C you would have saved $30.00

$ java InternetServiceProviderPart2

Enter the customer's package (A, B, or C): B

Enter the number of hours used: 777

Invalid input, please enter number of hours between 0 & 720.

Let's try again.

Enter the customer's package (A, B, or C): B

Enter the number of hours used: 40

The charges are $33.95

With package C you would have saved $14.00

$ java InternetServiceProviderPart2

Enter the customer's package (A, B, or C): C

Enter the number of hours used: 100

The charges are $19.95

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

Students also viewed these Programming questions