-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtext1.js
60 lines (50 loc) · 1004 Bytes
/
text1.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
var age;
var reg;
var i=1;
var j=1000;
function race(age,reg)
{
document.write("Your age is " +age );
document.write("\n");
document.write(" You are " +reg);
document.write("\n");
if(age<=25)
{
console.log(" race number is less than or equal to 1000");
while(i<1000)
{
document.write(" Your race number is " +i);
i++;
break;
}
document.write("\n");
document.write("Starting time is 12:30pm.");
}
else if (age>25 && reg=="early")
{
console.log("race number is more than 1000");
while(j>=1000)
{
document.write(" Your race number is " +j);
j++;
break;
} document.write("\n");
document.write(" Starting time is 9:30 am. ");
}
else if( age>25 && reg=="late")
{
while(i<1000)
{
document.write(" Your race number is " +i);
i++;
break;
}
document.write("\n");
document.write(" Starting time is 11:00 am. ");
}
}
race(18,"late");
document.write("<br>");
race(30,"early");
document.write("<br>");
race(60,"late");