-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMouse.cpp
More file actions
40 lines (32 loc) · 1.1 KB
/
Mouse.cpp
File metadata and controls
40 lines (32 loc) · 1.1 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 "Mouse.h"
#include <iostream>
#include <iomanip>
using namespace std;
Mouse::Mouse(string name, double price, int stock, string desc, int dpiValue, bool wireless, int buttons, string sensor)
: Product(name, price, stock, desc), dpi(dpiValue), isWireless(wireless), numButtons(buttons), sensorType(sensor) {}
// methods
void Mouse::displayDetails() const {
cout << "\n===== MOUSE DETAILS =====\n";
cout << "Name: " << name << "\n";
cout << "Price: $" << fixed << setprecision(2) << price << "\n";
cout << "Stock: " << stock << " units\n";
cout << "Description: " << description << "\n";
cout << "DPI: " << dpi << "\n";
cout << "Connection: " << (isWireless ? "Wireless" : "Wired") << "\n";
cout << "Buttons: " << numButtons << "\n";
cout << "Sensor: " << sensorType << "\n";
cout << "=========================\n";
}
int Mouse::getDPI() const {
return dpi;
}
bool Mouse::getIsWireless() const {
return isWireless;
}
int Mouse::getNumButtons() const {
return numButtons;
}
string Mouse::getSensorType() const {
return sensorType;
}