-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComputerAssembly.cpp
More file actions
98 lines (80 loc) · 1.71 KB
/
Copy pathComputerAssembly.cpp
File metadata and controls
98 lines (80 loc) · 1.71 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include "ComputerAssembly.h"
ComputerAssembly::ComputerAssembly()
{
gc = new GraphicsCard;
SD = new StorageDevice;
NC = new NetworkCard;
battery = new Battery;
PS = new PowerSupply;
totalPrice = 0.0;
PC_case = {};
}
ComputerAssembly::ComputerAssembly(double totalPrice, Battery *battery, PowerSupply *PS, NetworkCard* NC, StorageDevice* SD, GraphicsCard* gc)
: totalPrice(totalPrice), battery(battery), PS(PS),NC(NC),SD(SD),PC_case(PC_case),gc(gc)
{
}
Battery & ComputerAssembly::get_battery()
{
return *battery;
}
void ComputerAssembly::set_battery(Battery *battery)
{
this->battery = battery;
}
Case & ComputerAssembly::get_PC_case()
{
return PC_case;
}
void ComputerAssembly::set_PC_case(Case& PC_case)
{
this->PC_case = PC_case;
}
StorageDevice & ComputerAssembly::get_SD()
{
return *SD;
}
void ComputerAssembly::set_SD(StorageDevice *SD)
{
this->SD = SD;
}
PowerSupply &ComputerAssembly::get_PS()
{
return *PS;
}
void ComputerAssembly::set_PS(PowerSupply* PS)
{
this->PS = PS;
}
NetworkCard &ComputerAssembly::get_NC()
{
return *NC;
}
void ComputerAssembly::set_NC(NetworkCard *NC)
{
this->NC = NC;
}
double ComputerAssembly::get_totalPrice()
{
return this->totalPrice;
}
void ComputerAssembly::set_totalPrice(double totalPrice)
{
this->totalPrice= totalPrice;
}
GraphicsCard* ComputerAssembly::get_gc()
{
return gc;
}
void ComputerAssembly::set_gc(GraphicsCard* gc)
{
this->gc = gc;
}
//de-allocating dynamic memory
ComputerAssembly::~ComputerAssembly()
{
delete SD;
delete NC;
delete PS;
delete battery;
delete gc;
}