219k views
1 vote
Write a Raptor program that askes the user for 5 temperature inputs from 40 to 120 degrees F and then displays a table of the temperatures along with the average temperature and the minimum and maximum temperature.

Using loops, ask the user for 5 temperatures and store the temperature inputs in an array (load the array). Make sure you check that the inputs are in the range of 40 – 120. The array name follows the same naming convention as a variable.
You must load all the the user inputs into the array before beginning part 2.
Using a loop, read the temperature values from the array (unload the array) and calculate the sum, average value of the 5 temperatures and the minimum and maximum temperatures. Display a list / table of the temperatures, average temperature and the min and max values.
Sample output:
Temperature values
___________________
45.6
67.2
45.8
55.7
70.1
Average temperature is: 56.88 degrees F.
Minimum temperature is: 45.6 degrees F.
Maximum temperature is: 70.1 degrees F.
use flowchart

1 Answer

5 votes

Final answer:

The Raptor program entails creating a flowchart to handle user input of 5 temperature values, validating them within a specific range, storing them in an array, and then calculating and displaying the average, minimum, and maximum temperatures along with a list of input temperatures.

Step-by-step explanation:

The task is to create a Raptor flowchart that can receive, validate, and process temperature inputs. The flowchart will include a loop to ask the user for 5 temperature inputs and will check if they are within the range of 40 to 120 degrees Fahrenheit. Valid inputs will then be stored in an array. After the temperature inputs have been collected, another loop will be used to unload the array and calculate the sum, average, minimum, and maximum temperature values. Finally, the program will display the temperatures in a table, as well as the average, minimum, and maximum temperatures.

Sample Raptor Flowchart Steps:


  1. Start the program.

  2. Declare an array to store temperature values.

  3. Loop 5 times asking the user for temperature input.

  4. Validate if the temperature is between 40 and 120 degrees F.

  5. Store the valid temperature in the array.

  6. Once all inputs are stored, begin another loop to read from the array.

  7. Calculate the sum, average, minimum, and maximum from the array values.

  8. Output the temperature values, average, minimum, and maximum temperatures.

  9. End the program.

For example, after executing the program, the output would be similar to this:

Temperature values

___________________

45.6

67.2

45.8

55.7

70.1
Average temperature is: 56.88 degrees F.
Minimum temperature is: 45.6 degrees F.
Maximum temperature is: 70.1 degrees F.

User Andras K
by
8.2k points