Skip to content

Commit 367e7f0

Browse files
committed
Class 2 studio work
1 parent 82e6d65 commit 367e7f0

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed
Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,61 @@
11
// Initialize Variables below
2+
let date = "Monday 2019-03-18"
3+
let time = "10:05:34 AM"
4+
let astronautCount = 7
5+
let astronautStatus = "Ready"
6+
let averageAstronautMassKg = 80.7
7+
let crewMassKg = astronautCount * averageAstronautMassKg
8+
let fuelMassKg = 760000
9+
let shuttleMassKg = 74842.31
10+
let totalMassKg = crewMassKg + fuelMassKg + shuttleMassKg
11+
let maximumMassLimit = 850000
12+
let fuelTempCelcius = -225
13+
let minimumFuelTemp = -300
14+
let maximumFuelTemp = -150
15+
let fuelLevel = 100
16+
let weatherStatus = "clear"
17+
let preparedForLiftoff = true
218

319
// add logic below to verify total number of astronauts for shuttle launch does not exceed 7
20+
if (astronautCount => 7) {
21+
console.log ("Astronaut count: " + astronautCount);
22+
}
423

524
// add logic below to verify all astronauts are ready
6-
25+
if (astronautStatus == "Ready") {
26+
console.log ("Astronauts are ready!");
27+
} else {
28+
console.log ("Astronauts are not ready!");
29+
}
730
// add logic below to verify the total mass does not exceed the maximum limit of 850000
31+
if (totalMassKg <= 850000 ) {
32+
console.log("Total Mass: " + totalMassKg + "kg");
33+
} else {
34+
console.log("Too heavy!");
35+
}
836

937
// add logic below to verify the fuel temperature is within the appropriate range of -150 and -300
38+
if (fuelTempCelcius > minimumFuelTemp && fuelTempCelcius < maximumFuelTemp) {
39+
console.log ("Fuel Temperature: " + fuelTempCelcius);
40+
} else {
41+
console.log("Check the fuel temperatures.");
42+
}
1043

1144
// add logic below to verify the fuel level is at 100%
45+
if (fuelLevel == 100) {
46+
console.log ("Fuel level: " + fuelLevel + "%");
47+
} else {
48+
console.log ("Add more fuel");
49+
}
1250

1351
// add logic below to verify the weather status is clear
14-
52+
if (weatherStatus == "clear") {
53+
console.log("Weather status: " + weatherStatus);
54+
}
1555
// Verify shuttle launch can proceed based on above conditions
56+
console.log ("Crew Mass: " + crewMassKg + "kg" + '\n' +
57+
"Fuel Mass: " + fuelMassKg + "kg" + '\n' +
58+
"Shuttle Mass: " + shuttleMassKg + "kg" + '\n' +
59+
"Date: " + date + '\n' +
60+
"Time: " + time + '\n' +
61+
"Have a safe flight!")

booleans-and-conditionals/studio/package-lock.json

Lines changed: 6 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)