-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday_6_task.txt
57 lines (50 loc) · 1.55 KB
/
day_6_task.txt
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
1). Movie
class Movie{
constructor(hero,heroine,rr){
this.Hero = hero;
this.Heroine = heroine;
if(rr == undefined)
{
this.rating= 'PG'
}
else
{
this.rating = rr
}
get
}
}
var cinema1 = new Movie('vijay','joo')
var cinema2 = new Movie('ajith','sha','6')
var cinema3 = new Movie('surya','taman')
var cinema4 = new Movie('sk','priyan','8')
console.log(cinema1,cinema2,cinema3,cinema4)
-------------------------------------------------------------------
3).Write a “person” class to hold all the details.
class Person{
constructor(ggender,ssalary,aage,nname){
this.Name = nname;
this.age = aage;
this.salary = ssalary;
this.gender = ggender;
}
}
var noorul = new Person('male','26500','21','male')
console.log(noorul.salary)
console.log(noorul.Name)
---------------------------------------------------------
4). Uber Price
class Uber{
constructor(distance,rate,waitingtime){
this.distance = distance;
this.rate = rate;
this.waitingtime=waitingtime
}
getPrice()
{
var price = (this.distance+this.rate) + (this.waitingtime*2)
return price
}
}
var uberprice= new Uber(20,150,10)
console.log(uberprice.getPrice())