c++
(10) a. I have some data that represents information about TVs. The data for a TVs is the screen size, a ‘dumb’ or ‘smart’ remote and TV price. Define a structure (TVSpecs) that will hold the data described above for one TV.
(5) b. Now define a variable myTV that is of type TVSpecs
ANSWER : HERE IS THE ANSWER FOR YOUR QUESTION:
i have combined both the program intro a single one .
i have provided comments so that you can refer easily for the questions part as a and b
----------------------------------------------------------------------------------------------------------------
CODE:
#include <iostream>
using namespace std;
// 10.a
// defining the structure for the TVSpecs structure
struct TVSpecs
{
//screen_size as integer variable
int screen_size;
// string type variable as remote_type to hold data
string remote_type;
// float data type for storing the TV_price
float TV_price;
};
// 10.b
int main()
{
//ddefining the variable for the structure struct as myTV
TVSpecs myTV;
}
----------------------------------------------------------------------------------------------------------------
SNIPPET:
----------------------------------------------------------------------------------------------------------------
OUTPUT:
----------------------------------------------------------------------------------------------------------------
I hope this would help you out.
If you like my answer , please upvote
If you have any doubt, you can provide comment /feedback below the answer
Thanks
Get Answers For Free
Most questions answered within 1 hours.