Please due in C++ If you don't mind answering the questions as short as possible? 1 what variable type did you use to store your temperatures and why? 2what variable type did you use to store the indices into your arrays and why? 3 what variable type did you use to store averages and why? 4 would you prefer not to use arrays in this scenario?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
Please due in C++ If you don't mind answering the questions as short as possible? 1 what variable type did you use to store your temperatures and why? 2what variable type did you use to store the indices into your arrays and why? 3 what variable type did you use to store averages and why? 4 would you prefer not to use arrays in this scenario?
Enter the high value for day 2: 13
Enter the low value for day 2: 22
Incorrect values, temperatures must be in the range -40 to 40, high must be
greater than low.
Enter the high value for day 2: 22
Enter the low value for day 2: 13
Enter the high value for day 3: 34
Enter the low value for day 3:0
Enter the high value for day 4: 12
Enter the low value for day 4: -41
Incorrect values, temperatures must be in the range -40 to 40, high must be
greater than low.
Enter the high value for day 4: 12
Enter the low value for day 4: -3
The high temperatures were: 40 22 34 12
The low temperatures were: 12 13 0 -3
The average LOW temperature was: 5.50
The average HIGH temperature was: 27.00
The average temperature was: 16.25
The highest temperature was 40, on day 1
The lowest temperature was -3, on day 4
Transcribed Image Text:Enter the high value for day 2: 13 Enter the low value for day 2: 22 Incorrect values, temperatures must be in the range -40 to 40, high must be greater than low. Enter the high value for day 2: 22 Enter the low value for day 2: 13 Enter the high value for day 3: 34 Enter the low value for day 3:0 Enter the high value for day 4: 12 Enter the low value for day 4: -41 Incorrect values, temperatures must be in the range -40 to 40, high must be greater than low. Enter the high value for day 4: 12 Enter the low value for day 4: -3 The high temperatures were: 40 22 34 12 The low temperatures were: 12 13 0 -3 The average LOW temperature was: 5.50 The average HIGH temperature was: 27.00 The average temperature was: 16.25 The highest temperature was 40, on day 1 The lowest temperature was -3, on day 4
This lab monitors temperature for four days. It records the high and low for each day,
and validates the entries. At the end, the program prints a report.
●
This lab will test your ability to store information in arrays and use loops.
Remember to use Style Guidelines, with the right indentations and coding style as seen in
the lectures and the course material (include comments where necessary, and name your
variables appropriately).
Your program should be called tempMonitor.c and should run as follows:
It should prompt the user to enter the high temperature and the low
temperature for each day.
It should validate the entries as follows:
●
●
66%
●
●
+
O
The high temperature should not be greater than 40.
O
The low temperature should not be less than -40.
O
The low temperature should not be higher than the high temperature.
It should record the temperature for four days, using arrays to keep track of the
high and low temperatures for each day.
It should record the highest temperature and the day it occurred.
It should record the lowest temperature and the day it occurred.
It should calculate the average high temperature, the average low temperature,
and the average temperature overall.
At the end it should report the following:
O
The average low temperature.
The average high temperature.
O
O
O
O
The average temperature.
The highest temperature and the day it occurred.
The lowest temperature and the day it occurred.
Sample code that uses
A sample run is as follows:
with for-loops can be seen at Lab2Sample.c.
---=== SEP Temperature Analyzer ===---
Enter the high value for day 1: 41
Enter the low value for day 1: 12
Incorrect values, temperatures must be in the range -40 to 40, high must be
greater than low.
Enter the high value for day 1: 40
Enter the low value for day 1: 12
Transcribed Image Text:This lab monitors temperature for four days. It records the high and low for each day, and validates the entries. At the end, the program prints a report. ● This lab will test your ability to store information in arrays and use loops. Remember to use Style Guidelines, with the right indentations and coding style as seen in the lectures and the course material (include comments where necessary, and name your variables appropriately). Your program should be called tempMonitor.c and should run as follows: It should prompt the user to enter the high temperature and the low temperature for each day. It should validate the entries as follows: ● ● 66% ● ● + O The high temperature should not be greater than 40. O The low temperature should not be less than -40. O The low temperature should not be higher than the high temperature. It should record the temperature for four days, using arrays to keep track of the high and low temperatures for each day. It should record the highest temperature and the day it occurred. It should record the lowest temperature and the day it occurred. It should calculate the average high temperature, the average low temperature, and the average temperature overall. At the end it should report the following: O The average low temperature. The average high temperature. O O O O The average temperature. The highest temperature and the day it occurred. The lowest temperature and the day it occurred. Sample code that uses A sample run is as follows: with for-loops can be seen at Lab2Sample.c. ---=== SEP Temperature Analyzer ===--- Enter the high value for day 1: 41 Enter the low value for day 1: 12 Incorrect values, temperatures must be in the range -40 to 40, high must be greater than low. Enter the high value for day 1: 40 Enter the low value for day 1: 12
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education