Space Shuttle Fuel Needed
You are writing a program that computes the vertical, horizontal and straight line distance between the landing pad and a space shuttle given the coordinates of both the landing pad and space shuttle.
Use the straight line distance and fuel rate to compute the amount of fuel needed to bring the space shuttle back to the landing pad.
Report the vertical, horizontal and straight line distances as well as the fuel needed.
Algorithm
Write an algorithm for this program that includes the input, variables needed, computations needed to process the data, and output.
Test Your Algorithm
Before implementing your program, identify some test cases for your program and detemine the corresponding output. When creating test cases, ask yourself these questions and determine how your program should handle each case:
- Are there values that would result in negative distances?
- Are there values that would result in a distance that is 0?
- Are there values that would result in a negative amount of fuel needed?
- Are there values that would result in a fuel amount needed that is 0?
|
An AI Minute, Let's Use AI! |
| Be sure to tell AI that you do not want it to provide you with any code at this time. Give AI the initial prompt and provide it with your algorithm and test cases. Here's a sample prompt: Do not provide any program code at this time. I have been asked to write the following program ___insert prompt_____. I've developed the following algorithm to guide my programming. I've identified the following test cases. What additional test cases and results should I use to verify my program is working as intended? How are these test cases different than the test cases I provided? What new scenario are these test cases checking? Why should I use these additional test cases? Before making any updates to your test cases, analyze what the AI provided by asking yourself these questions: Do you agree with their suggestions, or is what you wrote more accurate? Did AI suggest any test cases that are already being tested by the ones you have already developed? |
Write Your Program
Write your program and include proper documentation that includes the following:
- A header with your name, date, program purpose, and items that are stored in inventory.
- A description of what each variable represents
- A description of the program input
- A description of the calculations
- A description of the output that includes two examples of output based on described input.
Run and test your program with the test cases you developed.