-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRace Day Code.txt
More file actions
58 lines (58 loc) · 2.79 KB
/
Race Day Code.txt
File metadata and controls
58 lines (58 loc) · 2.79 KB
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
console.log(`Codecademy's Annual Race`);
console.log(`Registeres Ticket`);
console.log(`--------------------------------------------`);
console.log(`This Imformation is for all registered early, late, and youth race. put your age where it says let = '' in the string (Replace it!), don't touch anything else that out the string, it can mess with our ticket system, if you do you will be fined!`);
console.log(`Fine: $3500`)
console.log(`--------------------------------------------`);
// Code Starts here:
let raceNumber = Math.floor(Math.random() * 1000);
// The Code above is provided by Codecademy
let early = 'Early Race';
let late = 'Late Race';
let youth = 'Youth Race';
// This Imformation is for all registered early, late, and youth race. put your age where it says let = '' in the string (Replace it!), don't touch anything else that out the string, it can mess with our ticket system, if you do you will be fined! Fine: $3500;
//Registering: Place your age after the age = ' ';
let age = 18;
// This Imformation is for all registered early, late, and youth race. put your age where it says let = '' in the string (Replace it!), don't touch anything else that out the string, it can mess with our ticket system, if you do you will be fined! Fine: $3500;
// Comapny: You can switch anything in the string to 'late, Early, and Youth Race';
let race = 'late Race';
//Early Race Code:
if(race === 'Early Race' && age > 18){
raceNumber += 1000;
}
if(race === 'Early Race' && age > 18){
console.log(`You will be the part of the ` + race + `, your age is ` + age + '.');
}
if(race === 'Early Race' && age > 18){
console.log(`Race will being at 9:30, your race number is ${raceNumber}.`);
}
//Late Race Code:
if(race === 'Late Race' && age > 18){
raceNumber += 1000;
}
if(race === 'Late Race' && age > 18){
console.log(`You will be the part of the ` + race + `, your age is ` + age + `.`);
}
if(race === 'Late Race' && age > 18){
console.log(`Race will being at 11:00, your race number is ${raceNumber}.`);
}
//Youth Race Code:
if(race === 'Youth Race' && age < 18){
raceNumber < 1000;
}
if(race === 'Youth Race' && age < 18){
console.log(`You will be the part of the ` + race + `, your age is ` + age + `.`);
}
if(race === 'Youth Race' && age < 18){
console.log(`Race will being at 12:30, your race number is, ${raceNumber}.`);
}
// Age = 18 Solution:
if(age === 18){
console.log('Information: We do not know if you are part of the Youth or the Late and early race because your age is exactly 18.');
}
if(age === 18){
console.log('Please approach the registration desk, thanks!');
}
// Reminder Code:
console.log(`--------------------------------------------`);
console.log(`Reminder: Do not lose your ticket at all cost, you will have to buy a new one if you lose this.`);