++ question 1 Monitor class header file: Monitor.h Instructions: 1.  Code the class specification file and name it as Monitor.h.  You can code the constructor initialization steps in-line. The rest of the member functions should just be prototypes. The class specification should define the prototypes of each functions.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

C++

question 1

Monitor class header file: Monitor.h

Instructions:

1.  Code the class specification file and name it as Monitor.h.  You can code the constructor initialization steps in-line. The rest of the member functions should just be prototypes.

The class specification should define the prototypes of each functions.


Class name:  Monitor
Private Member Attributes:

  1. string brand
  2. string model
  3. int    width (px) 
  4. int    height(px)
  5. int    ppi
  6. double refreshRate (hz)
  7. char   speakers (Y/N)
  8. int    ports (no. of ports)
  9. string portType (list of port types separated by commas)

Public Member Inline Functions

  1. Default Constructor with no parameters will initialize all numeric variables to 0.
  2. Constructor that accepts 3 int parameters for width, height, ppi.  This constructor defaults the brand to "Generic", model to "Basic", the refreshRate to 60, speakers to 'N', ports to 1, and portType to "HDMI".
  3. Destructor  (empty destructor)

Public Member Functions as Prototypes:

  1. Prototype for Setters (Mutators) for each member attribute that takes parameter for the attribute and returns no value.
  2. Prototype for Getters (Accessors) for each member attribute returns the data type as specified in the attribute list.
  3. 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:

       
Use: sqrt() and pow(x,y) functions

        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"

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY