-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathEXERCISE 3.JS
141 lines (128 loc) · 3.4 KB
/
EXERCISE 3.JS
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// 1.
class furniture{
constructor(Made, Make, Width, Height ){
this.made = Made;
this.Make = Make;
this.width = Width;
this.Height = Height;
}
}
let furniture1 = new furniture("chinese made", "wood", "80cm", "100cm")
console.log(furniture1)
console.log(furniture1.Make);
console.log(furniture1["Height"])
// 2.
class students{
constructor(name, nationality, color, house){
this.name = name;
this.nationality = nationality;
this.color = color;
this.house = house;
}
}
let Data = new students("Allan", "Nigerian", "brown", "house1")
console.log(Data)
console.log(Data.nationality);
console.log(Data["name"])
// 3.
class Client{
constructor(name, nationality, Address, Id){
this.name = name;
this.nationality = nationality;
this.Address = Address;
this.Id = Id;
}
}
let Client1 = new Client("Calvin", "Ugandan", "Lira", 8)
console.log(Client1)
console.log(Client1.nationality);
console.log(Client1["name"])
// 4.
class Phone{
constructor(make, type, user,){
this.make = make;
this.type = type;
this.user = user;
}
}
let phone1 = new Phone("Sumsung", "Smartphone", "Asians",)
console.log(phone1)
console.log(phone1.make);
console.log(phone1["user"])
// 5.
class tables{
constructor(material, color, width, Height){
this.material = material;
this.type = color;
this.width = width;
this.Height = Height;
}
}
let officetables = new tables("wood", "black", "100cm", "90cm")
console.log(officetables)
console.log(officetables.material);
console.log(officetables["width"])
// 6
class partners{
constructor(country, continent, number, payment){
this.country = country;
this.continent = continent;
this.number = number;
this.payment = payment;
}
}
let PartnerA = new partners("China", "Asia", "NO.1", "PAYPAL")
console.log(PartnerA)
console.log(PartnerA.payment);
console.log(PartnerA["continent"])
// 7
class districts{
constructor(Amount, Allocation, reffereneNo, payment){
this.Amount = Amount;
this.Allocation = Allocation;
this.reffereneNo = reffereneNo;
this.payment = payment;
}
}
let district1 = new districts("5billion", "Health", "RefNo.01", "Bank")
console.log(district1)
console.log(district1.Allocation);
console.log(district1["Amount"])
// 8
class building{
constructor(type, realEstate, location,){
this.type = type;
this.realEstate = realEstate;
this.location = location;
}
}
let Apartment1 = new building("Bangalore", "Air BnB", "Entebbe",)
console.log(Apartment1)
console.log(Apartment1.type);
console.log(Apartment1["location"])
// 9
class Animals{
constructor(Breed, Color, Origin, Usage){
this.Breed = Breed;
this.Color = Color;
this.Origin = Origin;
this.Usage = Usage;
}
}
let AnimalA = new Animals("Zebu", "Brown", "Scotland", "Beef")
console.log(AnimalA)
console.log(AnimalA.Usage);
console.log(AnimalA["Origin"])
// 10
class Site{
constructor(location, clientsName, houseNumber, Address){
this.location = location;
this.clientsName = clientsName;
this.houseNumber = houseNumber;
this.Address = Address;
}
}
let Site1 = new Site("Kampala", "John", "F1504", "Kira 2 road")
console.log(Site1)
console.log(Site1.Address);
console.log(Site1["location"])