-
Notifications
You must be signed in to change notification settings - Fork 0
/
address.h
64 lines (61 loc) · 1.29 KB
/
address.h
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
#include <iostream>
#include <string>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <ctime>
#include <cmath>
#pragma warning(disable : 4996)
using namespace std;
class address
{
public:
int houseNumber;
string townName;
int streetNumber;
string city;
address(int hN = 0,string tN = "",int sN = 0,string c = "")
{
houseNumber = hN;
townName = tN;
streetNumber = sN;
city = c;
}
void setAddress()
{
cout << "\t\t\t\t House Number = ";
int num = houseNumber;
mustBeInteger(num);
houseNumber = num;
cout << "\t\t\t\t Town Name = ", cin >> townName;
cout << "\t\t\t\t Street Number = ";
int num2 = streetNumber;
mustBeInteger(num2);
streetNumber = num2;
cout << "\t\t\t\t City = ", cin >> city;
}
int getHouseNumber()
{
return houseNumber;
}
int getStreetNumber()
{
return houseNumber;
}
string getCity()
{
return city;
}
string getTownName()
{
return townName;
}
void displayAddress()
{
cout << "\t\t\t\t House number = "<< houseNumber <<endl;
cout << "\t\t\t\t Town Name = " << townName << endl;
cout << "\t\t\t\t Street number = " << streetNumber << endl;
cout << "\t\t\t\t City = "<< city << endl;
}
};