Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem: You will write a program to compute some statistics based on daily high temperatures recorded throughout the three summer months (June, July, and August).

image text in transcribed
image text in transcribed
Problem: You will write a program to compute some statistics based on daily high temperatures recorded throughout the three summer months (June, July, and August). The 2017 data for New Braunfels has been downloaded from wunderground.com, and placed in a file named "tempdata17.txt'", available on the class website. This file has the following format: the first line describes the file contents. The remaining lines each contain a date followed by the high temperature for that day The temperatures are in order, so that the first one is for June 1, the second is for June 2, and so on through July and August. To keep things simple, I have deleted the rows for 7/31 and 8/31, so we can assume each month has exactly 30 days. The statistics you should compute in your program are: .The average daily high temperature for the entire summer The number of days that reached at least 100 degrees for the entire summer The maximum temperature for each month and on what day it occurred. Input: Your program should ask the user for the name of the file, and then open that file for input. The remainder of the input data will come from that file. You may assume that the data in the file will follow the format described above, and your program should compute correct statistics for any data file that follows that format. Processing: Compute the statistics requested above. Output: Display the statistics, labeled, and with the average temperature formatted to 1 decimal place. Sample output (continued onto page 2): Please enter the name of the temperature data file: tempdata17.txt High temperature statistics for the summer: Average daily high temperature: 96.7 Number of days that reached 100 degrees: 26 Maximum temperature for June: 102 occurred on June 23 Maximum temperature for July: 107 occurred on July 30 Maximum temperature for August: 101 occurred on August 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions