Skip to content

Commit 199284c

Browse files
authored
Merge pull request #5 from LaunchCodeEducation/revised-solutions
Revised solutions
2 parents 100717b + 71fbd55 commit 199284c

File tree

10 files changed

+34
-124
lines changed

10 files changed

+34
-124
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vscode/

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"cSpell.ignoreWords": [
3+
"esnext"
4+
]
5+
}

exercises/part1-2.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

exercises/part1-2.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

exercises/part3.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

exercises/part3.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

exercises/part4.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

exercises/part4.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

exercises/part5.js renamed to exercises/parts1-5.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
"use strict";
2+
// URL for the instructions:
3+
// https://education.launchcode.org/intro-to-professional-web-dev/chapters/typescript/exercises.html
24
exports.__esModule = true;
3-
// Add your import statement to line 2:
5+
// Part 5: Import statement.
46
var SpaceLocation_1 = require("./SpaceLocation");
7+
// Part 1: Remaining variables.
58
var kilometersToMars = 225000000;
69
var kilometersToTheMoon = 384400;
10+
// Part 2: Content moved into class. Output statements updated.
11+
// Part 3: Content moved into class. Output statements updated.
12+
// Part 4: Define your Spacecraft class:
713
var Spacecraft = /** @class */ (function () {
814
function Spacecraft(name, speedMph) {
915
this.milesPerKilometer = 0.621;
@@ -20,8 +26,8 @@ var Spacecraft = /** @class */ (function () {
2026
};
2127
return Spacecraft;
2228
}());
23-
// Create an instance of Spacecraft:
24-
var spaceShuttle = new Spacecraft('Discovery', 17500);
25-
// Print the output for the trips to Mars and the moon:
29+
// Create an instance of the class here:
30+
var spaceShuttle = new Spacecraft('Determination', 17500);
31+
// Part 5: Paste in the code from step 6 here:
2632
spaceShuttle.printDaysToLocation(new SpaceLocation_1.SpaceLocation('Mars', kilometersToMars));
2733
spaceShuttle.printDaysToLocation(new SpaceLocation_1.SpaceLocation('the Moon', kilometersToTheMoon));

exercises/part5.ts renamed to exercises/parts1-5.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
// Add your import statement to line 2:
1+
// URL for the instructions:
2+
// https://education.launchcode.org/intro-to-professional-web-dev/chapters/typescript/exercises.html
3+
4+
// Part 5: Import statement.
25
import { SpaceLocation } from './SpaceLocation';
36

7+
// Part 1: Remaining variables.
48
let kilometersToMars: number = 225000000;
59
let kilometersToTheMoon: number = 384400;
610

11+
// Part 2: Content moved into class. Output statements updated.
12+
13+
14+
// Part 3: Content moved into class. Output statements updated.
15+
16+
17+
// Part 4: Define your Spacecraft class:
18+
719
class Spacecraft {
820
milesPerKilometer: number = 0.621;
921
name: string;
@@ -25,9 +37,10 @@ class Spacecraft {
2537
}
2638
}
2739

28-
// Create an instance of Spacecraft:
29-
let spaceShuttle = new Spacecraft('Discovery', 17500);
40+
// Create an instance of the class here:
41+
let spaceShuttle = new Spacecraft('Determination', 17500);
42+
3043

31-
// Print the output for the trips to Mars and the moon:
44+
// Part 5: Paste in the code from step 6 here:
3245
spaceShuttle.printDaysToLocation(new SpaceLocation('Mars', kilometersToMars));
33-
spaceShuttle.printDaysToLocation(new SpaceLocation('the Moon', kilometersToTheMoon));
46+
spaceShuttle.printDaysToLocation(new SpaceLocation('the Moon', kilometersToTheMoon));

0 commit comments

Comments
 (0)