Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in C++ 7. Consider the class Motherboard below. class Motherboard { friend ostream& operator>(istream& in, MotherBoard& m); private: string mbBrand, cpuBrand; double

Write a program in C++

image text in transcribed

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

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

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

Compare and contrast long-term and short-term orientation cultures

Answered: 1 week ago