Question: The Wireless department of Costco Wholesale store has promotions for blackfriday. if you buy Note 20 and make a contract with Verizon as your carrier then you will get $300. if you buy iphone12 and make a contract with AT&T then you will get one iPhone8 free, if you buy Galaxy 20 ultra or Galaxy 20 FG, and you make a contract with T-mobile then you will get $200. if you buy Galaxy watch3 or apple watch 6 and make a contract with Verizon then you will get another watch free.
- if you buy Note 20 and make a contract with Verizon as your carrier then you will get $300.
- if you buy iphone12 and make a contract with AT&T then you will get one iPhone8 free,
- if you buy Galaxy 20 ultra or Galaxy 20 FG, and you make a contract with T-mobile then you will get $200.
- if you buy Galaxy watch3 or apple watch 6 and make a contract with Verizon then you will get another watch free.
PROGRAM:
#include<iostream>
#include<string> //to use getline()
using namespace std;
int main()
{
string Device,Carrier;
cout<<"Enter the device to purchase"<<endl;
getline(cin,Device); //read device name through getline() which takes total line as string
cout<<"Enter the Carrier to make contract"<<endl;
getline(cin,Carrier); //read carrier
if(Device=="Note 20" && Carrier=="Verizon")
cout<<"promotion is $"<<300<<endl; //prompt user promotion is 300
else if(Device=="iphone12" && Carrier=="AT&T")
cout<<"iPhone8 Free"<<endl; //prompt user about iPhone8 Free
else if((Device=="Galaxy 20 ultra" || Device=="Galaxy 20 FG") && Carrier=="T-mobile")
cout<<"promotion is $"<<200; //prompt user promotion is 200
else if((Device=="Galaxy watch3" || Device=="apple watch 6") && Carrier=="Verizon")
cout<<"Another watch free!!"; //prompt user watch is free
}
Step by step
Solved in 2 steps with 1 images