-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSSD.cpp
More file actions
40 lines (34 loc) · 1.1 KB
/
SSD.cpp
File metadata and controls
40 lines (34 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
// SSD class
#include "SSD.h"
#include <iostream>
#include <iomanip>
using namespace std;
// the constructor
SSD::SSD(string name, double price, int stock, string desc, int cap, int read, int write, string form)
: Product(name, price, stock, desc), capacity(cap), readSpeed(read), writeSpeed(write), formFactor(form) {}
// methods
void SSD::displayDetails() const {
cout << "\n===== SSD DETAILS =====\n";
cout << "Name: " << name << "\n";
cout << "Price: $" << fixed << setprecision(2) << price << "\n";
cout << "Stock: " << stock << " units\n";
cout << "Description: " << description << "\n";
cout << "Capacity: " << capacity << "GB\n";
cout << "Read Speed: " << readSpeed << " MB/s\n";
cout << "Write Speed: " << writeSpeed << " MB/s\n";
cout << "Form Factor: " << formFactor << "\n";
cout << "=======================\n";
}
int SSD::getCapacity() const {
return capacity;
}
int SSD::getReadSpeed() const {
return readSpeed;
}
int SSD::getWriteSpeed() const {
return writeSpeed;
}
string SSD::getFormFactor() const {
return formFactor;
}