Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include Monitor.h int main ( ) { / / Instantiate the first monitor object Monitor monitor 1 ; monitor 1 . setBrand (

#include
#include "Monitor.h"
int main(){
// Instantiate the first monitor object
Monitor monitor1;
monitor1.setBrand("John");
monitor1.setModel("H243H");
monitor1.setWidth(1920);
monitor1.setHeight(1080);
monitor1.setPpi(70);
// Calculate and display screen size for monitor1
std::cout << "Brand: "<< monitor1.getBrand()<<", Model: "<< monitor1.getModel()<<", Screen size (pixels)"
<< monitor1.getWidth()<<"x"<< monitor1.getHeight()<<" @ "<< monitor1.getPpi()<< "ppi, (diagonal)"
<< monitor1.getScreenSize()<<" inches" << std::endl;
// Instantiate the second monitor object
Monitor monitor2;
monitor2.setBrand("Doe");
monitor2.setModel("VX200");
monitor2.setWidth(1440);
monitor2.setHeight(980);
monitor2.setPpi(72);
// Calculate and display screen size for monitor2
std::cout << "Brand: "<< monitor2.getBrand()<<", Model: "<< monitor2.getModel()<<", Screen size (pixels)"
<< monitor2.getWidth()<<"x"<< monitor2.getHeight()<<" @ "<< monitor2.getPpi()<< "ppi, (diagonal)"
<< monitor2.getScreenSize()<<" inches" << std::endl;
return 0;
}

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

Step: 3

blur-text-image

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 Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

What magazine and ads did you choose to examine?

Answered: 1 week ago