Create a program that determines the cost of a cell phone bill by multiplying the number of minutes used in a month by 10 cents (0.10). The number of minutes cannot be negative and if a negative number is entered the user should be informed that there is an error. If the user enters more than 1000 minutes then they are charged an additional fee of 5 dollars. The program should display the number of minutes and the total cost only if number of minutes is not negative. Your program should use meaningful variables and the style of those names should follow the style presented in the class. You should also use constants when appropriate. Inputs should be restricted to a type that is appropriate for this program. The program should only display output that is listed in the requirements. Failure to follow these directions or the requirements listed above can result in the loss of points for this question. Partial credit can be earned by completing parts of the program correctly. You can refer to examples above.
Added by Carla S.
Step 1
Let's think step by step. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 79 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a program that calculates and prints the bill for a cellular telephone company. The company offers two types of service: regular and premium. Its rates vary, depending on the type of service. The rates are computed as follows: Regular service: $10.00 plus the first 50 minutes are free. Charges for over 50 minutes are $0.20 per minute. Premium service: $25.00 plus: a. For calls made from 6:00 a.m. to 6:00 p.m., the first 75 minutes are free; charges for more than 75 minutes are $0.10 per minute. b. For calls made from 6:00 p.m. to 6:00 a.m., the first 100 minutes are free; charges for more than 100 minutes 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 of r or R means regular service; a service code of p or P means premium service. Treat any other character as an error. Your program should output the account number, type of service, number of minutes the telephone service was used, and the amount due from the user. 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.
Akash M.
write a program to input number of calls from the user and and print the amount on the screen based on the following conditions number of calls 0-20 is rupees 5 per Call and above 200 is 10 rupees per call
Liam H.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD