Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answer in C++ please Farmers need to plant their crops early enough for the necessary growing season but late enough to avoid a killing frost.
Answer in C++ please
Farmers need to plant their crops early enough for the necessary growing season but late enough to avoid a killing frost. For this assignment you are to write a program that reads a file created with data from the National Climatic Data Center to determine the latest day in the spring that a frost has occurred. The file weatherDaily. dat contains several years of Greensboro daily weather data sorted by increasing date. Each line in the file represents one day's weather and contains the values: The program only requires the year, month, day and daily low, although your program must read all data values in each line. Each year in the file starts with January 1 and ends with December 31 . The data file has no characters after the last number digit, so the eof() function works effectively. Write a program that displays the date of last frost for each year in the file. We define a frost as any day when the temperature is less than or equal to 32 degrees. Spring frosts occur before July. Your program will need two variables to hold the month and day of a frost. An outline for the program would be: while more data in the file read one day's data values if the month is less than July \{ if the daily low temperature is less than or equal to zero save the month and day \} else if the day is July 1 display the year and the saved last month and dayStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started