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.
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.
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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fc84c7a92-2678-46ce-a5f5-3b112068b710%2F912ac5d8-106a-4d8d-91a8-347198452bf5%2Fpttwn0u_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)