Problem

Complete the following tasks:a. Create a class named TelevisionException that inherits fro...

Complete the following tasks:

a. Create a class named TelevisionException that inherits from runtime_error. The class constructor should accept a string argument that is passed to the parent as the what()message.


b. Create a class named Television that has data members to hold the model number of a television, the screen size in inches, and the price. Member functions include overloaded insertion and extraction operators. If more than four digits are entered for the model number, if the screen size is smaller than 12 or greater than 70, or if the price is negative or over $5,000, then throw a TelevisionException object with an appropriate message.


c. Write a main()function that instantiates a Television object, allows the user to enter data, and displays the data members. If an exception is caught, replace all the data member values with zero values. Save the file as Television.cpp.


d. Create a new application that instantiates an array of five television objects and allows the user to enter data for them. If an exception is caught, make the user reenter the data for that Television. Save the file as Television2.cpp.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT