Skip to content

Commit 3e5bab2

Browse files
committed
Studio
1 parent abe8c86 commit 3e5bab2

File tree

16 files changed

+3836
-7
lines changed

16 files changed

+3836
-7
lines changed
Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,64 @@
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 fuelTempCelsius = -225;
13+
let minfuelLevel = -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
4-
20+
if (astronautCount > 7) {
21+
preparedForLiftOff = false;
22+
}
523
// add logic below to verify all astronauts are ready
6-
24+
if (astronautStatus !== "ready") {
25+
preparedForLiftOff = false;
26+
}
727
// add logic below to verify the total mass does not exceed the maximum limit of 850000
28+
if (totalMassKg > maximumMassLimit) {
29+
preparedForLiftOff = false;
830

31+
}
932
// add logic below to verify the fuel temperature is within the appropriate range of -150 and -300
10-
33+
if (fuelTempCelsius < -300 || fuelTempCelsius > -150 ){
34+
preparedForLiftOff =false;
35+
}
1136
// add logic below to verify the fuel level is at 100%
12-
37+
if (fuelLevel !== "100%") {
38+
preparedForLiftOff == false;
39+
}
1340
// add logic below to verify the weather status is clear
41+
if (weatherStatus !== "Clear"){
42+
preparedForLiftOff = false;
43+
}
44+
1445

1546
// Verify shuttle launch can proceed based on above conditions
47+
if (preparedForLiftOff) {
48+
console.log("All systems are a go! Initiating space shuttle launch sequence.");
49+
console.log("---------------------------------------------------------------");
50+
console.log("Date:" + date);
51+
console.log("Time:" + time);
52+
console.log("Astronaut Count:" + astronautCount);
53+
console.log("Crew Mass:" + crewMassKg);
54+
console.log("Fuel Mass:" + fuelMassKg);
55+
console.log("Shuttle Mass:" + shuttleMassKg);
56+
console.log("Total Mass:"+ totalMassKg);
57+
console.log("Fuel Temperature:" + fuelTempCelsius);
58+
console.log("Weather Status:" + weatherStatus);
59+
console.log("----------------------------------------------------------------");
60+
console.log("Have A Safe Trip Astronauts");
61+
}else{
62+
console.log("Shut Down Launch");
63+
64+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
console.log('Bruce's beard');
2+
let message = "what's up, Doc?";
3+
let n = 17;
4+
let pi = 3.14159;
5+
6+
console.log(typeof message);
7+
console.log(typeof n);
8+
console.log(typeof pi);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const input = require('readline-sync');
22

3-
let num1 = input.question("Enter a number: ");
4-
let num2 = input.question("Enter another number: ");
3+
let num1 = input.question(3);
4+
let num2 = input.question(5);
55

66
console.log(num1 + num2);

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)