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

C ++ Programming Cellphone Plans Create a program that helps a customer shop for

ID: 673015 • Letter: C

Question

C ++ Programming

Cellphone Plans

Create a program that helps a customer shop for cell phone plans.

Two companies offer shared data plans with additional fees for each connected phone.

Altair Company Plan Offerings

Shared data up to: 2GB, 5GB, 15GB, 20GB. (If an in-between value, next up highest for example if 7 GB chosen, then 15 GB is plan expected.)

Monthly Data charge: $30, $50, $100, $140

Each phone costs $25 per month for plans with 5GB or less. Plans with 15GB or more charge $15 per month per phone.

Examples:

3 phones using 5 GB = $50 + $75 = $125.

4 phones using 8 GB (must purchase 15 GB) = $100 + $60 = $160.

Veloz Company Plan Offerings

Shared data up to: 1GB, 3GB, 6GB, 12GB, 18GB

Monthly data charge: $30, $45, $60, $80, $100

Each phone that is added to the plan costs an additional $20.

Examples: 3 phones using 5 GB (must purchase 6 GB) = $60 + $60 =$120.

4 phones using 8 GB (must purchase 12 GB) = $80 + $80 =$160.

Program Design:

The customer may request data amounts between 1 and 18 GB per month. If a customer requests a data amount that is not specifically listed in the plans, they must purchase the next higher plan

Also, the customer should specify how many phones will be connected. Verify that the user enters valid data. If not, you may display a message and exit the program. Determine which plan from each company will meet the user’s needs, and display the results to the user with the estimated pricing.

Explanation / Answer

#include<iostream>

using namespace std;

int main(){
   int usage,noOfPhones,amount;
   cout<<"Enter usage:"<<endl;
   cin>>usage;
   cout<<"Enter additional phones:"<<endl
   cin>>noOfPhones;
   if(usage <= 2){
       amount = 30 + noOfPhones*25;
   }
   else if(usage <= 5){
       amount = 50 + noOfPhones*25;
   }
   else if(usage <= 15){
       amount = 100 + noOfPhones*15;
   }
   else if(usage <= 20){
       amount = 140 + noOfPhones*15;
   }
   cout<<"Amount:"<<amount;
   return 0;
}