Java program that calculates the bill for a cellular


Java program that calculates the bill for a cellular telephone company. The company offers two types of service: regular and premium. The rates vary depending on the type of service. The rates are computed as follows:

Regular service: $10.00 plus first 50 minutes used each month are included in the $10.00 monthly service fee. Charges for minutes used over 50 minutes each month are $0.20 per minute.

Premium service: $25.00 plus:

a. For calls made from 6:00AM to 6:00PM, the first 75 minutes used each month are included in the $25.00 monthly service fee; charges for minutes used over 75 minutes each month are $0.10 per minute.

b. For calls made from 6:00PM to 6:00AM, the first 100 minutes used each month are included in the $25.00 monthly service fee; charges for minutes used over 100 minutes each month are $0.05 per minute.

Your program should prompt the user to enter an account number, a service code (type char), and the number of minutes the service was used. A service code (or R) means regular service; while code (or P) means premium service.

For the premium service (code P), the customer may be using the service during both the day and at night. Therefore, you must ask the user to input the number of minutes used during the day and the number of minutes used at night (do not prompt for total minutes).

The program should output, on separate lines and with proper labels, the account number, service type, number of minutes the service was used, and the amount due from the user.

Solution Preview :

Prepared by a verified Expert
Business Management: Java program that calculates the bill for a cellular
Reference No:- TGS02335762

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)