-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonitor.cpp
More file actions
40 lines (33 loc) · 1.15 KB
/
Monitor.cpp
File metadata and controls
40 lines (33 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Tyeon Ford
#include "Monitor.h"
#include <iostream>
#include <iomanip>
using namespace std;
// monitor's constructor
Monitor::Monitor(string name, double price, int stock, string desc, int size, string res, int refresh, string panel)
: Product(name, price, stock, desc), screenSize(size), resolution(res), refreshRate(refresh), panelType(panel) {}
// methods
void Monitor::displayDetails() const {
cout << "\n===== MONITOR DETAILS =====\n";
cout << "Name: " << name << "\n";
cout << "Price: $" << fixed << setprecision(2) << price << "\n";
cout << "Stock: " << stock << " units\n";
cout << "Description: " << description << "\n";
cout << "Screen Size: " << screenSize << '"' << "\n";
cout << "Resolution: " << resolution << "\n";
cout << "Refresh Rate: " << refreshRate << "Hz\n";
cout << "Panel Type: " << panelType << "\n";
cout << "===========================\n";
}
int Monitor::getScreenSize() const {
return screenSize;
}
string Monitor::getResolution() const {
return resolution;
}
int Monitor::getRefreshRate() const {
return refreshRate;
}
string Monitor::getPanelType() const {
return panelType;
}