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

Examine the following class diagram, additional information and answer the quest

ID: 3593386 • Letter: E

Question

Examine the following class diagram, additional information and answer the questions that follow screenType: char screenSize: int resolution: string price: double standard: boo1 TV(char= 'L', int= 50, string=" HD", double= 600, bool = true ) setorder )void displayvoid getPrice() :double etstandard (:bool; Additional Information Meth tv char = 'L,, nt S0, string ="HD", double -600, bol - true | Constructor with default values. The tional arguments are screenType. screenSize, resolution, price and standard Set the data members accordingly. [Note: Screen type O stands for OLED and L stands for LCD. Screensize is can be "HD and "UHD getprice double getStandard):bool; setOrdeoi Assessor for data members, price and standard Prompt the user to enter the screenType, screenSize and resolution. The default price $600 is for standard size (50 inch). screen type (LCD) and resolution HD). If there is any change to standard values, set standard to faise. If the screenTvpe is O add S300. If the screenSize is greater than 50 inch, add $20 for LCD TVs and $40 for OLED TVs for each additional inch If the resulution is UHD, add $200 for LCD TVs and $400 for OLED TVs. Update the price accordin Uses cout to display the respective data members. If standard is me, displays "Standard TV.· If standard is false. displays "Customised TV display:void (a) (b) (c) Write a function, displayMenu that display the following menu. The function accepts Develop C Develop C+ code to implement ALL methods found in the TVclass. validates the input and returns the valid choice to the calling program. code to implement the TV specification. (5 marks) (10 marks) TV Sales Systen Menu 1· Order TV 2. Dasplay Your Order 3. Display the orders that differ fron the standard values (type or size or resolution) 4. Display the TV with the highest price: 5. Exit Enter choice (1 to 5): (5 marks) (d) Write a test driver to test and fiulfil at least the following requirements. ( Declares an array of 5 TV objects. (ii) Calls the function displayMem0 in a loop and invokes the respective methods of (iii) Option1: invoke the method, setOrder and performs boundary check for the (iv) Option 2: uses a loop to invoke the aisplay method of array of IVobjects TV class coresponding to the selected choice. aray of IVobjects Option 3: traverses the array of IVobjects and displays the orders that differ from Option 4: traverses the array of TVobjects to find the IVwith the highest price. loop. (v) the standard values (type or size or resolution) (vi) (vii) Option 5: displays the message. Thank you for using the program..." and exit the Include a screen output in vour submission. (15 marks)

Explanation / Answer

#include<bits/stdc++.h>
using namespace std;


class TV
{
public:
char screentype;
int screenSize;
string resolution;
double price;
bool standard;

TV()
{
screentype='L';
screenSize=50;
resolution="HD";
price=600;
standard=true;

}

public:
double getPrice()
{
return price;
}

bool getStandard()
{

return standard;

}

public:
void setOrder()
{

cout<<"Enter ScreenType,ScreenSize and resolution";
cin>>screentype;
cin>>screenSize;
cin>>resolution;

if(screentype!='L' | screenSize!=50 )
{
standard=false;
}


if(screentype=='O')
{
price=price+300;

}
if(screenSize>50)
{
if(screentype=='L)
{
price=price+(screenSize-50)*20;

}
else if(screentype=='O')
{
price=price+(screenSize-50)*40;
}

if(resolution=="UHD")
{

price=price+200;

}


else if(resolution=="OLED")
{
price=price+400;

}

}


}


void display()
{
if(standard==true)
{
cout<<screentype<<endl;
cout<<price<<endl;

}
else
{
cout<<"Customized values:";

cout<<screentype<<endl;
cout<<screenSize<<endl;
cout<<resolution<<endl;
cout<<price<<endl;

}

}

};

int main()
{
TV obj;

obj.setOrder();
obj.display();

//cout<<obj.screentype;
//cout<<obj.getPrice();
return 0;


}

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