Write an application in java that calculates the cost of cell phone service. The
ID: 645185 • Letter: W
Question
Write an application in java that calculates the cost of cell phone service. The base cost is 10.99. Your program will provide a list of options as numbers, and the user will select options one at a time until the user enters 0 to stop. This is an accumulation operation because we are accumulating the total cost of the cell phone service.
Follow the instructions to complete your program.
1. Display available options and index them with numbers,
1 1,000 anytime minutes: 25.49
2 Unlimited weekend minutes: 6.99
3 Nationwide long distance: 12.99
4 Text messaging: 5.99
2. Request user to enter options one at a time until the user enters 0 to stop. If the input is not a number between 0 and 4, display an error message and request another option.
3. Calculate the current total cost. Format the output in $ notation using NumberFormat and display the output.
4. Display the formatted total cost of cell phone service.
Hint: you would need a loop for user to select options. A switch or if statement would be needed for calculating the cost.
Explanation / Answer
#include<stdio.h>
void main()
{int choice;
double rate=0;
do{
printf(
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.