Question
A mobile service provider has three different subscription packages for its customers: Package A: For $50 per month, 5 GB data are provided. Additional data
A mobile service provider has three different subscription packages for its customers: Package A: For $50 per month, 5 GB data are provided. Additional data is $15 per GB.
Package B: For $65 per month, 10 data are provided. Additional data is $10 per GB.
Package C: For $75 per month unlimited data provided. Text messaging and voice services are included in all of the companys data packages. The Mobile Service Company offers a roaming and long distance call services with an additional cost. The roaming service will add $15 and the long distance call service will add $7 to the customers monthly estimate. Design a Mobile Service Calculator to estimate the clients monthly payment. Write a program that calculates an estimate of the customers monthly bill. It should ask which package the customer will purchased and their monthly data consumption. Include a 11.5 % service tax and $7.54 charge from FCC (Federal Communications Commission). Do Input Validations for plan selected by user and their monthly data consumption (GB). Allow the user to do a new monthly estimate without exit the program. In addition, the program will display the customer savings with other plans. Finally, the program recommends the best plan for the customer based on the estimate of the monthly payment and computed savings if apply
import java.util.Scanner;
public class ServiceCalculator { public static void main(String[] args) { Scanner sc=new Scanner(System.in); char Package; double GBUsed; double monthlyBill = 0; while(true){ System.out.print("Enter Package (A/B/C) :"); Package = sc.next().charAt(0); System.out.print("Enter GB Used :"); GBUsed = sc.nextDouble(); if((Package=='A'||Package=='B'||Package=='C')&&(GBUsed>=0 && GBUsed<=50)){ break; } else { System.out.println(" Invalid Input Enter the details again --------------------"); } } switch(Package){ case 'A': if(GBUsed<=5){ monthlyBill = 50; } else{ monthlyBill = 50 + ((GBUsed-5)*15); } break; case 'B': if(GBUsed<=10){ monthlyBill = 65; } else{ monthlyBill = 65 + ((GBUsed-10)*10); } break; case 'C': monthlyBill = 75; break; } System.out.printf(" Monthly bill = $%.2f ",monthlyBill); if(GBUsed<=5 ){ if(Package!='A') System.out.println("Suitable package for your usage is 'A'"); else System.out.println("You have choosen correct package for your usage"); } else if(GBUsed<=10){ if(Package!='B' ) System.out.println("Suitable package for your usage is 'B'"); else System.out.println("You have choosen correct package for your usage"); } else if(GBUsed>10){ if(Package!='C') System.out.println("Suitable package for your usage is 'C'"); else System.out.println("You have choosen correct package for your usage"); } } }
What do I include as part of the solution?
UML diagrams
Methods Description Sheet
Methods Algorithms
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started