-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMobile.cpp
More file actions
73 lines (62 loc) · 1.62 KB
/
Copy pathMobile.cpp
File metadata and controls
73 lines (62 loc) · 1.62 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
#include <string>
#include <iostream>
#include <random>
#include <cmath>
#include "Date.cpp"
using std::string;
class Mobile {
private:
string OS {"Android"};
int year;
int month;
int day;
int storage = 64;
string simtype = "physical"; // physical or esim
public:
long sim_id;
long IMEI;
string serialnum = "0000";
Date date = Date();
// default constructor for class
Mobile() {
std::mt19937 gen32;
IMEI = abs(gen32());
sim_id = abs(gen32());
}
// Overloaded Constructor
Mobile(long imei) {
std::mt19937 gen32;
IMEI = imei;
sim_id = abs(gen32());
}
// Overloaded Constructor
Mobile(long imei, long sim) {
IMEI = imei;
sim_id = sim;
}
// getter and setters for private functions
// set and getter for simtype can only be esim or physical
void setsimtype(string st) {
if (st == "ESIM" || st == "esim" || st == "eSim") {
simtype = st;
}
}
string getsimtype() { return simtype; }
// setter and getter for storage (must be multiple of 8)
void setstorage(int storage) {
if (storage % 8 == 0) {
// Mobile::storage = storage;
this->storage = storage;
}
}
int getstorage() { return storage; }
bool connect_wifi(string wifiname, string pass) {
// Connect to provided wifi with password
std::cout << "We connected!\n";
return true;
}
void send_text(string txt) {
// send the message to someone and return if worked
std::cout << "You: " << txt << "\n";
}
};