Studio: Shuttle Launch
In this studio, you are going to write code to verify that your Space Shuttle is prepared for LiftOff! This activity will combine knowledge you have gained from this chapter and the Data and Variables Chapter
The starter code for this studio can be found inside of the following repository:
This studio activity will consist of 3 parts:
- Initializing variables with shuttle specifications.
- Writing conditional statements to check
ifyour shuttle meets specific requirements and is cleared for LiftOff.
- Verify that all conditional statements have passed in order to launch the shuttle, otherwise aborting the launch sequence.
Start out by creating the below variables with the given values. Remember to account for different data types.
We want to make sure that the following conditions are met in order for our shuttle to launch. Create a statement for each condition:
astronautCountis no greater than 7
- if the
totalMassKgis less than the
- if the
fuelTempCelsiusis no less than
-300OR no greater than
Verify the Shuttle is Cleared for LiftOff
Once you have completed the above conditions, print out the following shuttle information below and wish your astronauts a safe flight! If the above conditions are not met, shut down the launch operations.
- Wish your astronauts a safe flight!