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:
tableMonitorbrand: stringmodel: stringwidth: intheight: intppi: intsetBrandb: string: voidsetModelm: string: voidsetWidthw: int: voidsetHeighth: int: voidsetPpip: int voidgetBrand: stringgetModel: stringgetWidth: intgetHeight: intgetPpi: intgetScreenSize: 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
Use: sqrt and pow functions from cmath include library.
Prototype for listMonitor that takes no parameter and no return value but generates cout of the the Monitor as:
Brand: Acer,Model: HHScreen size pixelsx @ ppi, diagonal "result of getScreenSize"
Upload the Monitor.h file to this question.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
