-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstruct-1.cpp
More file actions
78 lines (65 loc) · 1.99 KB
/
struct-1.cpp
File metadata and controls
78 lines (65 loc) · 1.99 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
#include <iostream>
#include <iomanip>
using namespace std;
struct Village
{
string name;
int population;
int men;
int women;
};
struct Church
{
string name;
string address;
int members;
string pastor;
};
int main()
{
Village abak;
Village uyo;
// Initialization for village - Abak
abak.name = "Abak";
abak.population = 200;
abak.men = 80;
abak.women = 120;
// Initialization for village - Uyo
uyo.name = "Uyo";
uyo.population = 400;
uyo.men = 200;
uyo.women = 200;
Church apostolic;
Church anglican;
// Initialization for church - Apostolic
apostolic.name = "Apostolic Faith Church";
apostolic.address = "Ibeju Lekki, Lagos";
apostolic.members = 250;
apostolic.pastor = "Rev. Ogunriola";
// Initialization for church - Anglican
anglican.name = "Anglican Church";
anglican.address = "Ikeja, Lagos";
anglican.members = 150;
anglican.pastor = "Rev. Daniel Jacob";
cout << "Village (Abak)\n---------" << endl;
cout << "Name: " << abak.name << endl;
cout << "Population: " << abak.population << endl;
cout << "Men: " << abak.men << endl;
cout << "Women: " << abak.women << endl << endl;
cout << "Village (Uyo)\n---------" << endl;
cout << "Name: " << uyo.name << endl;
cout << "Population: " << uyo.population << endl;
cout << "Men: " << uyo.men << endl;
cout << "Women: " << uyo.women << endl << endl;
cout << "Church (Apostolic)\n---------" << endl;
cout << "Name: " << apostolic.name << endl;
cout << "Address: " << apostolic.address << endl;
cout << "Members: " << apostolic.members << endl;
cout << "Pastor: " << apostolic.pastor << endl << endl;
cout << "Church (Anglican)\n---------" << endl;
cout << "Name: " << anglican.name << endl;
cout << "Address: " << anglican.address << endl;
cout << "Members: " << anglican.members << endl;
cout << "Pastor: " << anglican.pastor << endl << endl;
return 0;
}