File tree Expand file tree Collapse file tree 3 files changed +38
-7
lines changed Expand file tree Collapse file tree 3 files changed +38
-7
lines changed Original file line number Diff line number Diff line change 1+ // URL for the instructions:
2+ // https://education.launchcode.org/intro-to-professional-web-dev/chapters/typescript/exercises.html
3+ // Part 1: Add the 5 variables here
4+ var spacecraftName = "Determination" ;
5+ var speedMph = 17500 ;
6+ var kilometersToMars = 225000000 ;
7+ var kilometersToTheMoon = 384400 ;
8+ var milesPerKilometer = 0.621 ;
9+ // Code part 2 here:
10+ var milesToMars = kilometersToMars * milesPerKilometer ;
11+ var hoursToMars = milesToMars / speedMph ;
12+ var daysToMars = hoursToMars / 24 ;
13+ // Code the output statement here (use a template literal):
14+ console . log ( spacecraftName + " would take " + daysToMars + " days to get to Mars." ) ;
15+ // Part 3:
16+ // Code the "getDaysToLocation" function here:
17+ // Call the function and print the outputs for the Mars trip and the moon trip:
Original file line number Diff line number Diff line change 33
44// Part 1: Add the 5 variables here
55
6+ let spacecraftName : string = "Determination" ;
7+ let speedMph : number = 17500 ;
8+ let kilometersToMars : number = 225000000 ;
9+ let kilometersToTheMoon : number = 384400 ;
10+ let milesPerKilometer : number = 0.621 ;
611
712
13+ // Code part 2 here:
14+ let milesToMars : number = kilometersToMars * milesPerKilometer ;
15+ let hoursToMars : number = milesToMars / speedMph ;
16+ let daysToMars : number = hoursToMars / 24 ;
817
18+ // Code the output statement here (use a template literal):
19+ console . log ( `${ spacecraftName } would take ${ daysToMars } days to get to Mars.` ) ;
920
10- // Code part 2 here:
1121
22+ // Part 3:
23+ // Code the "getDaysToLocation" function here:
1224
1325
1426
15- // Code the output statement here (use a template literal):
27+
28+
29+ // Call the function and print the outputs for the Mars trip and the moon trip:
1630
Original file line number Diff line number Diff line change 11// URL for the instructions:
22// https://education.launchcode.org/intro-to-professional-web-dev/chapters/typescript/exercises.html
33
4- let spacecraftName : string = "Determination" ;
5- let speedMph : number = 17500 ;
6- let kilometersToMars : number = 225000000 ;
7- let kilometersToTheMoon : number = 384400 ;
8- let milesPerKilometer : number = 0.621 ;
4+ // let spacecraftName: string = "Determination";
5+ // let speedMph: number = 17500;
6+ // let kilometersToMars: number = 225000000;
7+ // let kilometersToTheMoon: number = 384400;
8+ // let milesPerKilometer: number = 0.621;
99
1010// Code the "getDaysToLocation" function here:
1111
You can’t perform that action at this time.
0 commit comments