Question: Monitor class header file: Monitor.h Instructions: Code the class specification file and name it as Monitor.h . You can omit the constructors and destructor prototypes.

Monitor class header file: Monitor.h Instructions:
Code the class specification file and name it as Monitor.h. You can omit the constructors and destructor prototypes. The rest of the member functions prototypes are required. The UML for the Monitor class is shown:
\table[[Monitor],[-brand: string],[-model: string],[-width: int],[-height: int],[-ppi: int],[+setBrand(b: string): void],[+setModel(m: string): void],[+setWidth(w: int): void],[+setHeight(h: int): void],[+setPpi(p: int) void],[+getBrand(): string],[+getModel(): string],[+getWidth(): int],[+getHeight(): int],[+getPpi(): int],[+getScreenSize(): int]]
The class specification should define the prototypes of each functions.
Class name: Monitor
Private Member Attributes:
string brand
string model
int width
int height
int ppi
Note that the width and height are in pixels (px). The property ppi means pixels per inch.
Public Member Functions as Prototypes:
Prototype for Setters (Mutators) for each member attribute that takes parameter for the attribute and returns no value.
Prototype for Getters (Accessors) for each member attribute returns the data type as specified in the attribute list.
Prototype for getScreenSize() function that calculates and returns the diagonal size of the monitor in inches. Be sure the data types will not demote numbers in the calculations. Use the formula:
Diagonal =(wp)2+(hp)22
Use: sqrt() and pow(x,y) functions from cmath include library.
4. Prototype for listMonitor() that takes no parameter and no return value but generates cout of the the Monitor as:
Brand: Acer,Model: H243H,Screen size (pixels)1920x1080 @ 70ppi, (diagonal) "result of getScreenSize"
Upload the Monitor.h file to this question.
 Monitor class header file: Monitor.h Instructions: Code the class specification file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!