Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ I completed my stage 1 but i don't know how to work with stage 2. input file smallTemp.txt smallWind.txt WCF 35.7 0.6T-35.7(V1) 0.43T(Vo16) You

C++

image text in transcribed

image text in transcribed

image text in transcribed

I completed my stage 1 but i don't know how to work with stage 2.

input file

smallTemp.txt

smallWind.txt

WCF 35.7 0.6T-35.7(V1) 0.43T(Vo16) You will declare and fill the temperature and wind speed arrays by reading files. You will find several sample files in the Starter Code directory that the test cases can pull from. For Stage 1, you simply need to write a code that reads in two files (one for temperature and one from wind speed) and creates to arrays to store that data. The first line of each.txt file is the number of days of data that exist in the file (and therefore needs to be read in). Then, you need to set up the days array (every odd day, as in Lab 6). Then, you need to calculate WCF, as in Lab 6. Finally you need to calculate and output the mean. This is what your console should look like: Temperature file? smalLTemp.txt Wind speed file? smallwind.txt Mean WCF: 21.1645 Error checking: For stage 1, you need to error checking to make sure that number of temperatures matches the number of wind speeds. If the sizes don't match, you should provide this error message and exit/return out of the program: Temperature file? medTemp.txt Wind speed file? smallwind.txt Error: Temp and Wind sizes do not match. You also need to have the same error checking message that was in Lab 5/Project 5 that alerts and return/exits the program if an invalid filename is given. Temperature file? notafile.txt Error: unable to open file! WCF 35.7 0.6T-35.7(V1) 0.43T(Vo16) You will declare and fill the temperature and wind speed arrays by reading files. You will find several sample files in the Starter Code directory that the test cases can pull from. For Stage 1, you simply need to write a code that reads in two files (one for temperature and one from wind speed) and creates to arrays to store that data. The first line of each.txt file is the number of days of data that exist in the file (and therefore needs to be read in). Then, you need to set up the days array (every odd day, as in Lab 6). Then, you need to calculate WCF, as in Lab 6. Finally you need to calculate and output the mean. This is what your console should look like: Temperature file? smalLTemp.txt Wind speed file? smallwind.txt Mean WCF: 21.1645 Error checking: For stage 1, you need to error checking to make sure that number of temperatures matches the number of wind speeds. If the sizes don't match, you should provide this error message and exit/return out of the program: Temperature file? medTemp.txt Wind speed file? smallwind.txt Error: Temp and Wind sizes do not match. You also need to have the same error checking message that was in Lab 5/Project 5 that alerts and return/exits the program if an invalid filename is given. Temperature file? notafile.txt Error: unable to open file

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