-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTablet.cpp
More file actions
38 lines (31 loc) · 1.02 KB
/
Tablet.cpp
File metadata and controls
38 lines (31 loc) · 1.02 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
//Student Bshara Haj, 212590186.
//Student Obaeda Khatib, 201278066.
#include "Tablet.h"
Tablet::Tablet(int price, const std::string& manufacturer, const std::string& color, const std::string& cpu, int numOfPorts, int screenSize)
: Item(price, manufacturer), PeripheralDevice(price, manufacturer, color, true), Computer(price, manufacturer, cpu, 0, numOfPorts), screenSize(screenSize)
{
}
Tablet::~Tablet()
{
}
int Tablet::getScreenSize() const
{
return screenSize;
}
void Tablet::setScreenSize(int screenSize)
{
this->screenSize = screenSize;
}
string Tablet::toString() const //to rewrite
{
return PeripheralDevice::toString() + ", Mouse with dpi : " + std::to_string(screenSize);
}
Tablet::operator string() const
{
return toString();
}
void Tablet::connect( Computer& computer) /////////deleted the two consts and add & before computer in eripheralDevice::connect(&computer);
{
std::cout << "Connecting a tablet" << std::endl;
PeripheralDevice::connect(&computer);
}