Skip to content

Commit d9dda27

Browse files
committed
2 parents 8ee0626 + c5f3a98 commit d9dda27

15 files changed

+3841
-2
lines changed
Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,74 @@
1+
// const input = require('readline-sync');
12
// Initialize Variables below
23

4+
5+
6+
7+
let date = "Monday 2019-03-18";
8+
let time = "10:05:34 AM"
9+
let astronautCount = 7
10+
let astronautStatus = "ready"
11+
let averageAstronautMassKg = 80.7
12+
let crewMassKg = astronautCount * averageAstronautMassKg
13+
let fuelMassKg = 760000
14+
let shuttleMassKg = 74842.31
15+
let totalMassKg = crewMassKg + fuelMassKg + shuttleMassKg
16+
let maximumMassLimit = 850000
17+
let fuelTempCelsius = -225
18+
let minimumFuelTemp = -300
19+
let maximumFuelTemp = -150
20+
let fuelLevel = 100
21+
let weatherStatus = "Clear"
22+
let preparedForLiftOff = true
23+
let error
24+
25+
console.log("All systems are a go! Initiating space shuttle sequence. \n -------------------------------------------------------");
26+
console.log("Date: " + date);
27+
console.log("Time: " + time);
28+
329
// add logic below to verify total number of astronauts for shuttle launch does not exceed 7
30+
if (astronautCount <= 7) {
31+
console.log("Astronaut Count: " + astronautCount)
32+
} else {
33+
error = "not ready";
34+
}
35+
436

537
// add logic below to verify all astronauts are ready
38+
if (astronautStatus === "ready"){
39+
console.log("Crew ready");
40+
} else {
41+
error = "not ready";
42+
}
643

744
// add logic below to verify the total mass does not exceed the maximum limit of 850000
45+
if (totalMassKg <= 850000){
46+
console.log("Crew mass: " + crewMassKg + "kg");
47+
}else {
48+
error = "not ready";
49+
}
850

951
// add logic below to verify the fuel temperature is within the appropriate range of -150 and -300
52+
if ((fuelTempCelsius >= minimumFuelTemp) && (fuelTempCelsius <= maximumFuelTemp) ){
53+
console.log("Fuel Temperature " + fuelTempCelsius + "C°");
54+
}else {
55+
error = "not ready";
56+
}
1057

1158
// add logic below to verify the fuel level is at 100%
12-
59+
if (fuelLevel === 100){
60+
console.log("Fuel at 100%");
61+
}else {
62+
error = "not ready";
63+
}
1364
// add logic below to verify the weather status is clear
65+
if (weatherStatus === "Clear"){
66+
console.log("Weather: " + weatherStatus);
67+
}else {
68+
error = "not ready" ;
69+
}
1470

1571
// Verify shuttle launch can proceed based on above conditions
72+
if (error != "not ready"){
73+
console.log("Have a safe trip astronauts!");
74+
}

data-and-variables/exercises/data-and-variables-exercises.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,11 @@ let hoursToMoon = milesToMoon / shuttleSpeedMph;
2626
let dayToMoon = hoursToMoon;
2727

2828
// Print the results of the trip to the moon below
29-
console.log(shuttleName + " will take " + dayToMoon + " days to reach Moon");
29+
console.log(shuttleName + " will take " + dayToMoon + " days to reach Moon");
30+
31+
32+
// ignore below
33+
34+
const input = require('readline-sync');
35+
36+
let info = input.question("Question text... ");

data-and-variables/exercises/node_modules/.package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

data-and-variables/exercises/node_modules/readline-sync/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

data-and-variables/exercises/node_modules/readline-sync/README-Deprecated.md

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)