Question

Please can someone help me with making this program in JAVA implementing classes. Also, include loops...

Please can someone help me with making this program in JAVA implementing classes. Also, include loops and selection structures.

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 company’s data packages. The MobileService 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 customer’smonthly estimate. Design a Mobile Service Calculator to estimate the client’s monthly payment. Write a program that calculates an estimate of the customer’s monthly bill. It should ask whichpackage 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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note: Could you plz go this code and let me know if u need any changes in this.Thank You
_________________

#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int main()
{
   //Declaring variables and constants
char package, ch;
double data;
char roaming, longDis;
const double SERVICE_TAX = 11.5;
const double FCC = 7.54;
double totalCharges = 0.0;
double savedb = 0, savedc = 0, saveda = 0;


/* This loop continues to execute until
   * the user enters a valid input
   */
while (true) {
   /* This while loop continues to execute
* until the user enters a valid number
*/
  
while (true) {
cout << "Enter the package name (A or B or C):";
cin >> package;
if (package == 'A' || package == 'a' || package == 'B' || package == 'b' || package == 'C' || package == 'c')
break;
else
cout << "** Invalid Choice **" << endl;
}

while (true) {
cout << "Enter monthly data consumption :";
cin >> data;
if (data < 0) {
cout << "** Invalid.Must be greater than zero **" << endl;
}
else
break;
}

switch (package) {
case 'A':
case 'a': {
if (data >= 0 && data <= 5) {
totalCharges = 50;
}
else {
totalCharges = 50 + (data - 5) * 15;
}

break;
}
case 'B':
case 'b': {
if (data >= 0 && data <= 10) {
totalCharges = 65;
}
else {
totalCharges = 65 + (data - 10) * 10;
}

break;
}
case 'C':
case 'c': {
totalCharges = 75;
break;
}
}

if (package == 'A' || package == 'A') {
if (data > 6 && data <= 10) {
savedb = totalCharges - 65;
}
else {
savedb = totalCharges - (65 + (data - 10) * 10);
}

if (data > 11) {
savedc = totalCharges - 75;
}

cout << "If u choose package B you might have saved :$" << savedb << endl;
cout << "If u choose package C you might have saved :$" << savedc << endl;

if (savedb > savedc) {
cout << "The Best Package which suits to your usage is package#B" << endl;
}
else {
cout << "The Best Package which suits to your usage is package#C" << endl;
}
}
else if (package == 'B' || package == 'b') {
if (data > 11) {
savedc = totalCharges - 75;
cout << "If u choose package C you might have saved :$" << savedc << endl;
cout << "The Best Package which suits to your usage is package#C" << endl;
}

if (data <= 5) {
saveda = totalCharges - 50;
cout << "The Best Package which suits to your usage is package#A" << endl;
cout << "If u choose package A you might have saved :$" << saveda << endl;
}
}
else {
if (data >= 6 && data < 11) {
savedb = totalCharges - 65;
cout << "If u choose package B you might have saved :$" << savedb << endl;
cout << "The Best Package which suits to your usage is package#B" << endl;
}
else if (data < 6) {
savedc = totalCharges - 50;
cout << "If u choose package C you might have saved :$" << savedc << endl;
cout << "The Best Package which suits to your usage is package#A" << endl;
}
}

while (true) {
cout << "Do you want roaming service (y/n):";
cin >> roaming;
if (roaming == 'y' || roaming == 'Y') {
totalCharges += 15;

break;
}
else if (roaming == 'n' || roaming == 'N') {
break;
}
else {

cout << "*Invalid choice*" << endl;
continue;
}
}

while (true) {
cout << "Do you want long distance call service (y/n):";
cin >> longDis;
if (longDis == 'y' || longDis == 'Y') {
totalCharges += 7;
break;
}
else if (longDis == 'n' || longDis == 'N') {
break;
}
else {

cout << "*Invalid choice*" << endl;
continue;
}
}

cout << "Total Charges :$" << totalCharges << endl;
cout << endl;
cout << "\nDo you Want to do new monthly estimate(Y/N):";
cin >> ch;

if (ch == 'y' || ch == 'Y') {
totalCharges = 0.0;
saveda = 0.0;
savedb = 0.0;
savedc = 0.0;

continue;
}
else {
break;
}
}

return 0;
}
________________________

Output:

_______________Could you plz rate me well.Thank You

Add a comment
Know the answer?
Add Answer to:
Please can someone help me with making this program in JAVA implementing classes. Also, include loops...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem: Mobile Service Provider A mobile service provider has three different subscription packages for its customers:...

    Problem: Mobile Service Provider 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 company's data packages. The Mobile Service Company offers...

  • Part 1: A mobile phone service provider has three different data plans for its customers: Package...

    Part 1: A mobile phone service provider has three different data plans for its customers: Package A: For $39.99 per month 4 gigabytes are provided. Additional data costs $10 per gigabyte. Package B: For $59.99 per month, 8 gigabytes are provided. Additional data costs $5 per gigabyte. Package C: For $69.99 per month, unlimited data is provided. Write a program that calculates a customer's monthly bill. It should ask which package the customer has purchased and how many gigabytes were...

  • In PYTHON code: Examples of output are as follows: If the user entered Package A and...

    In PYTHON code: Examples of output are as follows: If the user entered Package A and 30 GB of data, then you should get the following output: Mobile Service Provider Enter your mobile phone package (A, B or C): A How many gigabytes data did you use? 30 Your total cost for Package A is 299.99 If you had chosen Package C you would have saved $ 230.00 If you had chosen Package B you would have saved $ 130.00...

  • write in java and you must use methods.... Part I     Internet Service Provider An Internet service...

    write in java and you must use methods.... Part I     Internet Service Provider An Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer’s monthly bill....

  • Java Programming Problem description with its major requirements labeled from A to I. A mobile phone...

    Java Programming Problem description with its major requirements labeled from A to I. A mobile phone service provider has three different subscription packages for its customers: Package A: For $39.99 per month 450 minutes are provided. Additional minutes are $0.45 per minute. Package B: For $59.99 per month 900 minutes are provided. Additional minutes are $0.40 per minute. Package C: For $69.99 per month unlimited minutes are provided. Design a class MobileCharges that calculates a customer’s monthly bill. It should...

  • Assignment 8.3: Phone Chatbot (10 pts) For this programming assignment, we write a basic chatbot program....

    Assignment 8.3: Phone Chatbot (10 pts) For this programming assignment, we write a basic chatbot program. For fun, try having a conversation with an online chatbot here or here. Some sources estimate that 25% of customer services will be handled by Chatbots in 2020, vs. 2% in 2017 (1). The chatbot we are designing must ask you the following questions: What is your name? What is your phone number? What is your phone plan? How many GB of data this...

  • An Internet service provider offers four subscription packages to its customers, plus a discount for nonprofit...

    An Internet service provider offers four subscription packages to its customers, plus a discount for nonprofit organizations: Package A: 10 hours of access for $12.95 per month. Additional hours are $4.00 per hour. Package B: 20 hours of access for $14.95 per month. Additional hours are $2.00 per hour. Package C: 30 hours of access for $20 per month. Additional hours are $1.00 per hour. Package D: Unlimited access for $35.95 per month. A nonprofit organizations will get 20% discount...

  • write in C++ Problem 1: Mobile Service Provider A cell phone service provider has three different...

    write in C++ Problem 1: Mobile Service Provider A cell phone service provider has three different subscription packages for its customers. Package A: For $39.99 per month 450 minutes are provided. Additional minutes are $0.45 per minute. Package B: For $59.99 per month 900 minutes are provided. Additional minutes are $0.40 per minute. Package C: For $69.99 per month unlimited minutes provided. Write a program that calculates a customer’s monthly bill. It should ask which package the customer has purchased...

  • Making Decisions III CellPhoneService.java + 1 import java.util.Scanner; 2 public class CellphoneService >- Ter Write a...

    Making Decisions III CellPhoneService.java + 1 import java.util.Scanner; 2 public class CellphoneService >- Ter Write a program for Horizon Phones, a provider of cellular phone service. Prompt a user for maximum monthly values for talk minutes used, text messages sent, and gigabytes of data used, and then recommend the best plan for the customer's needs as well as the price of that plan. public static void main (String args[]) // declare variables here // prompt user to enter talk minutes...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT