WRITE A JAVA PROGRAM. Telco is a cellular telephone company that offers two types of service: standard and premium.  Its rates vary, depending on the type of service. The rates are computed as follows:   Calculate the amount due if given a service code (s or S means standard service; a service code of p or P means premium service), and the number of minutes the service was used. For the premium service, the customer may be using the service during the day and the night.  Therefore, to calculate the bill, you must ask the user to input the number of minutes the service was used during the day and the number of minutes the service was used during the night.   Input Description: There are service code (s, S, p or P) and usage amount u (u≥0). If the service code is p or P, then the usage has two types; day usage du(du≥0) and night usage nu(nu≥0).   Output Description: The format is RMt where t is the amount due in Malaysia currency format as shown in the sample output.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

WRITE A JAVA PROGRAM.

Telco is a cellular telephone company that offers two types of service: standard and premium.  Its rates vary, depending on the type of service. The rates are computed as follows:

 


Calculate the amount due if given a service code (s or S means standard service; a service code of p or P means premium service), and the number of minutes the service was used.

For the premium service, the customer may be using the service during the day and the night.  Therefore, to calculate the bill, you must ask the user to input the number of minutes the service was used during the day and the number of minutes the service was used during the night.

 

Input Description:

There are service code (s, S, p or P) and usage amount u (u≥0). If the service code is p or P, then the usage has two types; day usage du(du≥0) and night usage nu(nu≥0).

 

Output Description:

The format is RMt where is the amount due in Malaysia currency format as shown in the sample output.

 

Hint: Use the following declaration and statement for output formatting

Standard
Premium
RM38.00 plus;
RM48.00 plus;
a) The first 50 minutes are free. a) Day usage (6 am to 6 pm), the first 75
b) Charges for over 50 minutes minutes are free; charges for more than 75
are RMO.20 per minute.
minutes are RM0.10 per minute.
b) Night usage (6 pm to 6 am), the first 100
minutes are free; charges for more than 100
minutes are RM0.05 per minute.
Transcribed Image Text:Standard Premium RM38.00 plus; RM48.00 plus; a) The first 50 minutes are free. a) Day usage (6 am to 6 pm), the first 75 b) Charges for over 50 minutes minutes are free; charges for more than 75 are RMO.20 per minute. minutes are RM0.10 per minute. b) Night usage (6 pm to 6 am), the first 100 minutes are free; charges for more than 100 minutes are RM0.05 per minute.
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY