Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[JAVA PROGRAMMING LANGUAGE] Write a program that calculates and displays a customers monthly mobile bill in the main method of class Answer . The mobile

[JAVA PROGRAMMING LANGUAGE]

Write a program that calculates and displays a customers monthly mobile bill in the main method of class Answer.

The mobile phone service provider has three different subscription packages for the customers:

  • Package A: For $39.99 per month, 450 minutes are provided. Additional minutes are $0.45 per minute.
  • Package B: For $59.99 per month, 900 minutes are provided. Additional minutes are $0.40 per minute.
  • Package C: For $69.99 per month, unlimited minutes are provided.

The program should first ask the user to enter the package of the customer showing the message "Enter customer's package:".

Once the user enters the package, the program should ask the user to enter the number of minutes only if the package is either A or B (You should not be asking the user for the number of minutes talked if the plan is C), showing the message "Enter minutes talked:".

Once the inputs are complete, the program should display the bill total for the month in the format, "Bill total: $ddd.dd" (note that there should be only two decimal points in the display message).

Note 1: After each output to the console, there should be a newline character.

Note 2: You can assume input is always entered correctly.

(You should not be asking the user for the number of minutes talked if the plan is C)

answer:

public class Answer{

public static void main(String[] arg) { //TODO: Write your code here. } }

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

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

Students also viewed these Databases questions

Question

List some advantages of a POS system.

Answered: 1 week ago

Question

Does it avoid use of underlining?

Answered: 1 week ago