![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 17.04.2020 23:14 chem1014
For this exercise, you will be simulating a weather station responsible for recording hourly
temperatures and reporting on certain characteristics (e. g., average temperature) from your recordings.
You will also be expanding on your experience in creating functions and passing them more complex
parameters (i. e., complete array arguments).
Specifications:
DDI&T a C++ program to input, store, and process hourly temperatures for each hour of the day
(i. e., 24 temperatures). Your program should be divided logically into the following parts:
1. In function main() declare an array:
array HourlyTemperatures;
(where NUM_TEMPERATURES should be declared as a constant with the value, 24), that
will be used to hold one temperature for each hour of the day. Declare other variables and
constants as you feel are necessary.
2. Pass the HourlyTemperatures array to a function,
void GetTemperatures(array & Temperatures);
This function must interactively prompt for and input temperatures for each of the 24 hours
in a day (0 through 23). For each temperature that is input, verify that its value lies in the
range of minus 50 degrees and plus 130 degrees (i. e., validate your input values). If any
value is outside the acceptable range, ask the user to re-enter the value until it is within this
range before going on to the next temperature (HINT: use a nested loop (e. g., do-while) that
exits only when a value in the specified range has been entered). Store each validated
temperature in its corresponding element of the 24-element integer array passed as a
parameter to the function.
3. Next pass the filled array to a function,
double ComputeAverageTemp(array & Temperatures);
This function computes the average temperature of all the temperatures in the array and
returns this average to the calling function.
4. Finally, pass your array and the computed average temperature to another function,
void DisplayTemperatures(array & Temperatures,
double AverageTemp);
which displays the values of your temperature array in a columnar format followed by the
values for the high temperature, low temperature, and average temperature for the day.
NOTE: If you want to create separate function(s) to find and return the high and low
temperature values, then feel free to do so!
The resulting output should look like this:
Hour Temperature
00:00 42
01:00 42
. . . . . . . . // Your program output must include all of these too!
22:00 46
23:00 48
High Temperature: 68
Low Temperature: 42
Average Temperature: 57.4
5. Since you have created functions to perform each of the functional steps of your solution,
your main() function should be quite simple. The pseudo code for main() might look
something like this:
int main()
{
// declare local constant(s), variable(s), and array(s).
do
{
// call GetTemperatures(HourlyTemperatures) ;
// call ComputeAverageTemp(HourlyTemperatur es);
// call DisplayTemperatures(HourlyTemperatu res, AverageTemperature);
} while // user wants to process more days of temperatures
return 0;
}
6. Test your program with at least two (2) different sets of temperatures. Make sure you
enter values to adequately test your temperature-validation code (e. g., temperatures below –
50 and above +130 degrees).
Deliverable(s):
Turn in the properly documented source listing of your program and complete outputs from
at least TWO (2) test "runs". Additionally, turn in screen captures of some of your interactive inputs
demonstrating that your program properly detects invalid inputs and prompts the user to re-enter the
temperature(s). Starting with this exercise you must document your solution in accordance with the
examples shown at the back of this syllabus and provided on the Portal.
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 21:30, mjweed2456
Nathan wants to create multiple worksheet containing common formatting styles for his team members. which file extension him to save these worksheets? nathan to create multiple worksheets with common styles. he needs to save them with the extension.
Answers: 1
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 01:20, sosick90501
Write a function balancechemical to balance chemical reactions by solving a linear set of equations. the inputs arguments are: reagents: symbols of reagents in string row array products: symbols of products in string row array elements: elements in the reaction in string row array elcmpreag: elemental composition of reactants in two dimensional numeric array elcmpprdcts: elemental composition of prducts in two dimensional numeric array hint: the first part of the problem is setting up the set of linear equations that should be solve. the second part of the problem is to find the integers from the solution. one way to do this is to mulitiply the rational basis for the nullspace by increasing larger integers until both the left-and right-side integers exist. for example, for the reaction that involves reacting with to produce and : reagents=["ch4", "o2"]; products =["co2", "h2o"]; elements =["c","h", "o"] elcmpreag=[1,4,0;
Answers: 3
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 22:00, bb1593
Jackson, who works in the finance department of a company, is holding a seminar for other employees on how to file taxes. only three employees sign up to attend the seminar. which device can he use to share his presentation with a group of three employees?
Answers: 1
You know the right answer?
For this exercise, you will be simulating a weather station responsible for recording hourly
Questions in other subjects:
![Konu](/tpl/images/cats/fizika.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 31.07.2020 01:01
![Konu](/tpl/images/cats/informatica.png)
Computers and Technology, 31.07.2020 01:01
![Konu](/tpl/images/cats/mat.png)
Mathematics, 31.07.2020 01:01
![Konu](/tpl/images/cats/mat.png)
Mathematics, 31.07.2020 01:01
![Konu](/tpl/images/cats/en.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 31.07.2020 01:01