Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This needs to be written in JAVA and the print savings portions must work. Pretend you work for a cell service company. They offer three

This needs to be written in JAVA and the print savings portions must work.

Pretend you work for a cell service company. They offer three subscription plans, and you must code the billing logic!

Plan 1: For $29.99 per month, the customer receives 400 minutes. Overage minutes are $0.35 per minute.

Plan 2: For $49.99 per month, the customer receives 800 minutes. Overage minutes are $0.30 per minute.

Plan 3: For $59.99 per month, the customer receives unlimited minutes.

Your program must compute a customer's bill for that month.

Prompt (ask) the user to enter their name.

If the user enters an empty string or a string with less than 2 characters, show an error and do not print any calculations.

Prompt (ask) the user to enter a plan number.

If the user enters an invalid plan number, show an error and do not print any calculations.

Prompt (ask) the user for how many minutes they used.

If the user enters a number less than 0, show an error and do not print any calculations.

Use conditional logic to calculate the customer's bill using the plans above.

The bill must show the total amount due and the other fields shown below in the required output.

The bill should also display how much money the user would save (if any) using either of other two plans,. For example, if the user picks Plan 2, then show them how much money (if any) they would save with Plan 1 or Plan 3.

If there are no savings from upgrading packages, then a cost savings message should not be printed.

Where possible, use named constants instead of normal variables or hard-coded values.

Required output for Exercise 1 (based on the numbers entered--different numbers produce different output)

Enter the customer's name: Jack Black Enter a plan: 1 Enter the number minutes used: 510 Bill Name: Jack Black Plan: Plan 1 Plan Base Charge: $29.99 Plan Base Minutes: 400 Overage Minutes: 110 Price Per Minute Overage: $0.35 Overage Charge: $38.50 Total Bill: $68.49 Cost Savings: If you switched to Plan 2, you would have saved $18.50. If you switched to Plan 3, you would have saved $8.50.

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

Students also viewed these Databases questions