forked from TonyOjelel/Refactory-JavaScript-OOP-Classes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
opiniIsaac__opp.js
184 lines (149 loc) · 5.65 KB
/
opiniIsaac__opp.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// class of distrcts
class District {
constructor(name,county,subCounty,parish,village){
this.name= name;
this.county= county;
this.subCounty=subCounty;
this.parish=parish;
this.village=village;
}
}
// objects of districts
let district1 = new District("Moyo","westMoyo","Obongi","celecala","Edua")
let district2 = new District("Wakiso","kira","Namugongo","kyaliwagala","ssonde")
let district3 = new District("Kampala","kawempe","banda","kisaia","Eua")
let district4 = new District("Luwer0","westLuero","Obi","kyi","udi")
let district5 = new District("Gulu","tiptip","kii","bedidi","odo")
// class of countries
class Country{
constructor(name,president,year,language,city){
this.name = name;
this.president = president;
this.year =year;
this.language= language;
this.city=city;
}
}
let Country1 = ("Uganda","museveni",1962,"English","kampala")
let Country2 = ("kenya","kenyatta",1965,"English","nairobi")
let Country4 = ("rwanda","museveni",1966,"french","kigali")
let Country5 = ("Usa","biden",1890,"English","washingston")
// class of movie
class Music {
constructor(title,year,artist,label,duration){
this.title = title;
this.year= year;
this.artist = artist;
this.label= label;
this.duration=duration;
}
}
let music1 = new Music("fwa fwa",2020,"awzi","swangz",2)
let music2 = new Music("sorry",2015,"justin","sonny",4)
let music3 = new Music("location",2020,"dave","sonny",5)
let music4 = new Music("cocodile",2020,"skillbeng","carribean",2)
let music5 = new Music("fella",2016,"navyKenzo","tz",2)
class Movie{
constructor(title,director,year,actor,company){
this.title = title;
this.director = director;
this.year =year;
this.actor= actor;
this.company=company;
}
}
let movie1 = new Movie("Dune","Denis",2021,"zendaya","warner")
let movie2 = new Movie("Dispatch","Anderson",2020,"Bill","wSearchLight")
let movie3 = new Movie("power","campion",2021,"benedict","netflix")
let movie4 = new Movie("belfast","kenneth",2021,"Jamie","focus")
let movie5 = new Movie("licorice","Paul",2021,"Bradely","MGM")
// class of books
class Book{
constructor(title,author,pages,language,pulisher){
this.title=title;
this.author= author;
this.pages= pages;
this.language=language;
this.pulisher-pulisher;
}
}
let book1 = new Book("richDadPoorDad","robert",348,"English","mk")
let book2 = new Book("richestManInBabylon","tom",248,"English","MGN")
let book3 = new Book("power","%)cent",234,"English","mk")
let book4 = new Book("EloquentsJS","tim",348,"English","elok")
let book5 = new Book("softskils","Isaac",948,"English","mk")
// class of persons
class Person{
constructor(name,age,gender,address,occupation){
this.name=name;
this.age= age;
this.gender= gender;
this.address=address;
this.occupation-occupation;
}
}
let person1 = new Person("Tom",22,"male","sonde","student")
let person2 = new Person("Josh",42,"male","Ede","lawyer")
let person3 = new Person("Tracy",22,"female","sonde","doctor")
let person4 = new Person("Joan",62,"female","sonde","retired")
let person5 = new Person("Tom",32,"male","sonde","accountant")
// class of peoducts
class Product{
constructor(name,category,price,description,manufacturer){
this.name=name;
this.category= category;
this.price= price;
this.description=description;
this.manufacturer-manufacturer;
}
}
let product1 = new Product("Iphone14","phones",2000,"lastest","apple")
let product2 = new Product("Sumgung","phones",4000,"ultra 22","sumsung")
let product3 = new Product("MacBook","laptops",9000,"8gb ram","apple")
let product4 = new Product("usb","cables",900,"2meteres","apples")
let product5 = new Product("T-shirt","clothes",400,"small size","Vasace")
// class of customers
class Customer{
constructor(name,age,gender,email,phone){
this.name=name;
this.age= age;
this.gender= gender;
this.email=email;
this.phone-phone;
}
}
let customer1 = new Customer("Peter", 30, "male", "[email protected]",0_903_0930)
let customer2 = new Customer("chris", 34, "male", "[email protected]",0_903_0930)
let customer3 = new Customer("Jojo", 60, "female", "[email protected]",0_903_430)
let customer4 = new Customer("Peace", 40, "female", "[email protected]",0_903_0530)
let customer5 = new Customer("Pual", 30, "male", "[email protected]",0_903_0330)
// class of Laptop
class Laptop {
constructor(name,model,ScreenSize,ram,processor){
this.name=name;
this.model=model;
this.ScreenSize=ScreenSize;
this.ram=ram;
this.processor=processor;
}
}
let laptop1 = new Laptop ("apple","max book pro",16.5,"16gb","M2")
let laptop2 = new Laptop ("Hp","Envy",13.5,"8gb","intel")
let laptop3 = new Laptop ("Dell","brazer",16,"4gb","intel 5")
let laptop4 = new Laptop ("lenovo","notebook",15,"8gb","intel9")
let laptop5 = new Laptop ("Hp","Envy Pro",15,"16gb","intel")
// class of car
class Car{
constructor(make,model,year,color,mileage){
this.make=make;
this.model=model;
this.year=year;
this.color=color;
this.mileage=mileage;
}
}
let car1 = new Car (2022,"forestor",2022,"red",0)
let car2 = new Car (2015,"bugatti",2022,"blue",10)
let car3 = new Car (2022,"urs",2021,"red",200)
let car4 = new Car (2000,"primo",2023,"blue",100)
let car5 = new Car (1999,"ferrara",2022,"black",0)