Question: Using C++ Program: 7. Consider the class Motherboard below. class Motherboard { friend ostream& operator>(istream& in, MotherBoard& m); private: string mbBrand, cpuBrand; double price; int
Using C++ Program:

7. Consider the class Motherboard below. class Motherboard { friend ostream& operator>(istream& in, MotherBoard& m); private: string mbBrand, cpuBrand; double price; int noofCPUCore, lengthInCM, breadthInCM; public: Motherboard () = default; Implement the extraction operator function, such that when the following lines are executed: Motherboard mb; cin >> mb; the extraction operator function will prompt user to enter the Motherboard's brand, cpu's brand, price, no. of cpu core, length and breadth (in cm), to initialize its own (Motherboard) attribute's mb Brand, cpuBrand, price, noofCPUCore, lengthInCM, and breadthInCM respectively. Note that data stored in mbBrand, or cpu Brand could consist of more than 1 word. The entire Motherboard object should be thrown (as an exception object), if any of the following condition(s) is/are true : any string variables like Motherboard's brand / CPU's brand (entered by user) is an empty string the Motherboard's price (entered by user) is less than $100.00, or exceeds $500.50 the Motherboard's length in cm (entered by user) is less than 25, or exceeds 100 the Motherboard's breadth in cm (entered by user) is less than 15, or exceeds 100 the Motherboard's no. of CPU core (entered by user) is less than 2, or exceeds 32
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
