Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program for Horizon Phones, a provider of cellular phone service. Prompt

ID: 671110 • Letter: W

Question

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. A customer who needs fewer than 500 minutes of talk and no text or data should accept Plan A at $49 per month. A customer who needs fewer than 500 minutes of talk and any text messages should accept Plan B at $55 per month. A customer who needs 500 or more minutes of talk and no data should accept either plan C for up to 100 text messages at $61 per month or Plan D for 100 text messages or more at $70 per month. A customer who needs any data should accept Plan E for up to 2 gigabytes at $79 or Plan F for 2 gigabytes or more at $87.

Explanation / Answer

#include <iostream>
using namespace std;
int main()
{
int talkMinutes, textMessages, dataBytes;
cout<<"Welcome to HORIZON PHONES"<<endl; //Welcome Message.
cout<<"Enter the maximum value of talk minutes per month: "; //Reading Talk Minutes.
cin>>talkMinutes;
cout<<"Enter the maximum value of text messages per month: "; //Reading Text Messages.
cin>>textMessages;
cout<<"Enter the maximum number of gigaBytes of data per month: "; //Reading Data Bytes.
cin>>dataBytes;
//A customer who needs fewer than 500 minutes of talk and no text or data should accept Plan A at $49 per month.
if(talkMinutes < 500 && textMessages == 0 && dataBytes == 0)
cout<<"You are suggested to use Plan A at $49 per month."<<endl;
//A customer who needs fewer than 500 minutes of talk and any text messages should accept Plan B at $55 per month.
else if(talkMinutes < 500 && textMessages > 0)
cout<<"You are suggested to use Plan B at $55 per month."<<endl;
//A customer who needs 500 or more minutes of talk and no data...
else if(talkMinutes >= 500 && dataBytes == 0)
{
// And he has a textMessages of less than or equal to 100.
if(textMessages <= 100)
cout<<"You are suggested to use Plan C at $61 per month."<<endl;
//Or he has a texMessages of greater than 100.
else
cout<<"You are suggested to use Plan D at $70 per month."<<endl;
}
//A customer who needs any data...
if(dataBytes > 0)
{
//And he has a dataplan of less than or equal to 2 GB.
if(dataBytes <= 2)
cout<<"You are suggested to use Plan E at $79 per month."<<endl;
//Or he needs much more data.
else
cout<<"You are suggested to use Plan F at $87 per month."<<endl;
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote