ANSWER :
#include<iostream>
#include<string>
using namespace std;
//TV class
class TV
{
private :
char screenType;
int screenSize;
string resolution;
double price;
bool standard;
public :
//TV constructor with default values
TV(char screentype = 'L',int screensize = 50,string res= "HD",double pr = 600,bool std = true):
screenType(screentype),screenSize(screensize),resolution(res),price(pr),standard(std)
{
}
//getPrice() method
double getPrice()
{
return price;
}
//getStandard() method
bool getStandard()
{
return standard;
}
//setOrder method()
void setOrder()
{
cout<<"Enter the screenType :";
cin>>screenType;
cout<<"Enter the screenSize :";
cin>>screenSize;
cout<<"Enter the resolution :";
cin>>resolution;
if((screenType != 'L' ||screenType != 'l')||(screenSize !=50 )||(resolution !="HD"))
standard = false;
if(screenType == 'o'||screenType == 'O')
{
price += 300;
}
if(screenSize > 50)
{
if(screenType == 'L' ||screenType == 'l')
{
price += 20;
}
else if(screenType == 'o'||screenType == 'O')
{
price += 40;
}
}
if(resolution == "UHD" && (screenType == 'L' ||screenType == 'l'))
{
price += 200;
}
else if(resolution == "UHD" && (screenType == 'O' ||screenType == 'o'))
{
price += 400;
}
}
//display() method;
void display()
{
if(standard == true)
{
cout<<"Standard TV"<<endl;
}
else
{
cout<<"Customized TV"<<endl;
}
}
};
//displayMenu method
void displayMenu(TV& tv)
{
int choice;
cout<<" TV Sales System Menu"<<endl;
cout<<"------------------------------"<<endl;
cout<<"------------------------------"<<endl;
cout<<"1. Order TV "<<endl;
cout<<"2. Display Your Orders "<<endl;
cout<<"3. Display the orders that differ from the standard values(type or size or resolution): "<<endl;
cout<<"4. Display the TV with highest price: "<<endl;
cout<<"5. Exit "<<endl;
cout<<"Enter choice (1 to 5):"<<endl;
cin>>choice;
switch(choice)
{
case 1:
tv.setOrder();
break;
case 2:
tv.display();
case 3:
case 4:
case 5:
cout<<"Thank you for using the program...."<<endl;
break;
default:
cout<<"Wrong choice";
break;
}
}
//test driver method test()
void test()
{
TV tv[5];
int i;
for(i=0;i<4;i++)
{
displayMenu(tv[0]);
}
}
//main method
int main()
{
test();
}
OUTPUT :
Examine the following class diagram, additional information and answer the questions that follow screenType: char screenSize:...
I need help modifying this code please ASAP using C++ Here is what I missed on this code below Here are the instructions Here is the code Produce correct70 pts O pts Full Marks No Marks results and statisfy requirements view longer Comments 1. Your display amount is not readable 2. I withdraw more than my balance, but I didn't see any error message description Documentations10 pts 0 pts Full Marks No Marks : comment i code and block comment...
Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...
SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the company's new line of single-serve coffee pods or to await results from the product's launch in the United States. Key strategic decisions include choosing the target market to focus on and determining the value proposition to emphasize. Important questions are also raised in regard to how the new product should be branded, the flavors to offer, whether Kraft should use traditional distribution channels or...