-
Notifications
You must be signed in to change notification settings - Fork 6
/
Gabriel-oop.js
119 lines (107 loc) · 2.48 KB
/
Gabriel-oop.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
// 7 classes with atleast 5 parameters and properties
// computer class
let Computer = function (brand, core, ram, hhd, price) {
this.brand = brand;
this.core = core;
this.ram = ram;
this.hhd = hhd;
this.price = price;
};
//computer class objects
const computer1 = new Computer("Dell", "i7", "8 gb", "1 TB", 2500000);
const computer2 = new Computer("Toshiba", "i3", "2 gb", "500 GB", 1500000);
//house class
let House = function (area, bedRoom, bathRoom, storeyed, price) {
this.area = area;
this.bedRoom = bedRoom;
this.bathRoom = bathRoom;
this.storeyed = storeyed;
this.price = price;
};
//house objects
const house1 = new House("1500 sq ft", 5, 4, false, 150000000);
const house2 = new House("2000 sq ft", 6, 6, true, 700000000);
//TV class
let Tv = function (size, resolution, power, brand, serial) {
this.size = size;
this.resolution = resolution;
this.power = power;
this.brand = brand;
this.serial = serial;
};
//tv object
const tv1 = new Tv("43 inch", "4K", "100 Watts", "Samsung", "5678654321987");
const tv2 = new Tv("32 inch", "HD", "60 Watts", "LG", "7890888766499");
//Book class
let Book = function (title, author, pages, publisher, ISBN) {
this.title = title;
this.author = author;
this.pages = pages;
this.publisher = publisher;
this.ISBN = ISBN;
};
//Book class objects
book1 = new Book(
"Rhapsody of realities",
"Pastor Chris Oyakhilome",
85,
"Loveworld Publishers",
15966984
);
book1 = new Book(
"Advanced Pure Mathematics",
" John Okello",
300,
"MK Publishers",
45853652
);
//Country class
let Country = function (
name,
area,
population,
president,
officialLang,
capital
) {
this.area = area;
this.population = population;
this.president = president;
this.officialLang = officialLang;
this.capital = capital;
this.name = name;
};
//Country class objects
country1 = new Country(
"Uganda",
"450000 sq miles",
"45 Million",
"Yoweri Museveni",
"English",
"Kampala"
);
country2 = new Country(
"Rwanda",
"120000 sq miles",
"15 Million",
"Paul Kagame",
"French",
"Kigali"
);
// Continent class
let Continent = function (name, area, countries, population, density) {
this.name = name;
this.area = area;
this.countries = countries;
this.population = population;
this.density = density;
};
//Continent class objects
const africa = new Continent("Africa", "29648481 sq km", 53, 1340598147, 45);
const northAmer = new Continent(
"North America",
"21330000 sq km",
48,
592072212,
28
);