Skip to content

Commit 6f8ccba

Browse files
committed
HW Practice
1 parent b9d5844 commit 6f8ccba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+11409
-27
lines changed
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
// Declare and initialize the variables for exercise 1 here:
1+
let engineIndicatorLight = "red blinking";
2+
let spaceSuitsOn = true;
3+
let shuttleCabinReady = true;
4+
let crewStatus = spaceSuitsOn && shuttleCabinReady;
5+
let computerStatusCode = 200;
6+
let shuttleSpeed = 15000;
27

3-
// BEFORE running the code, predict what will be printed to the console by the following statements:
4-
5-
if (engineIndicatorLight === "green") {
6-
console.log("engines have started");
7-
} else if (engineIndicatorLight === "green blinking") {
8-
console.log("engines are preparing to start");
8+
if (shuttleSpeed > 17500) {
9+
console.log("ALERT: Escape velocity reached!");
10+
} else if (shuttleSpeed < 8000) {
11+
console.log("ALERT: Cannot maintain orbit!");
912
} else {
10-
console.log("engines are off");
11-
}
13+
console.log("Stable speed");
14+
}

booleans-and-conditionals/studio/data-variables-conditionals.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
// Initialize Variables below
22

3+
let date = "Monday 2019-03-18";
4+
let time = "10:05:34 AM";
5+
let astronautCount = 7;
6+
let astronautStatus = "ready";
7+
let averageAstronautMassKg = 80.7;
8+
let crewMassKg = astronautCount * averageAstronautMassKg;
9+
let fuelMassKg = 760000;
10+
let shuttleMassKg = 74842.31;
11+
let totalMassKg = crewMassKg + fuelMassKg + shuttleMassKg;
12+
let maximumMassLimit = 850000;
13+
let fuelTempCelsius = -225;
14+
let minimumFuelTemp = -300;
15+
let maximumFuelTemp = -150;
16+
let fuelLevel = "100%";
17+
let weatherStatus = "clear";
18+
let preparedForLiftOff = true;
19+
320
// add logic below to verify total number of astronauts for shuttle launch does not exceed 7
21+
if (astronautCount <= 7 && astronautStatus === "ready" && totalMassKg < maximumMassLimit &&
22+
(fuelTempCelsius >= -300 && fuelTempCelsius <= -150) && fuelLevel === "100%" &&
23+
weatherStatus === "clear");
424

525
// add logic below to verify all astronauts are ready
626

data-and-variables/chapter-examples/node_modules/.package-lock.json

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

data-and-variables/chapter-examples/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/chapter-examples/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)