Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7. Consider the class Motherboard below. class Mother Board friend ostream& operator>(istream& in, Motherboard& m); private: string mbBrand, cpuBrand; double price; int noofcPuCore, lengthInCM, breadthInCM;

image text in transcribed

7. Consider the class Motherboard below. class Mother Board 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 mbBrand, cpuBrand, price, noofCPUCore, lengthInCM, and breadthInCM respectively. Note that data stored in mbBrand, or cpuBrand 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions