Sites/Resources

Note:

Lab 7: Shuttle Launch

Goals: To make use of the logical operators in a program

Overview: NASA has realized that the operator who is responsible for pushing the final green button to launch the shuttle has too many things to verify before the launch. They are looking at using some technology to solve this problem. You have been contracted to write a simple program that will print true if certain conditions have been met and the shuttle can be launched, or false otherwise. This program will be embedded in a device that will disable the big green button if the conditions are not right for the launch, thus scrubbing the mission.

The launch button should be enabled (your program should print true) if:

  1. the current temperature is above freezing and below 100 degrees Fahrenheit, exclusive
  2. the current cloud cover is less than 48% or the current cloud cover is less than 25% if it is raining, inclusive
  3. there has not been any lighting in the area for at least 45 minutes, inclusive
  4. the current wind speed is below 34 knots, inclusive
If these conditions are not met, the button should still be enabled if the manual override switch has been turned on.

Variables needed: Please use the following variables and give them appropriate initial values:

double curTemp;
double cloudCover;
boolean isRaining;
int timeSinceLastLightning;
double windSpeed;
boolean overrideIsOn;

Note: These are not the real conditions. To get an idea of how complicated things are, check out what the weather conditions really look like here or here.

What to do: Write a complete application named ShuttleLaunch.java that will print true if the above conditions have been met, or false otherwise.

What to submit: Show me your program when completed. I will check your program by choosing other initial values.

© Daubenmier/Ehrenfried 2005-2011
Comments