Question: Write a program to read 12 temperature values from a file called temps.dat and determine which is the minimum and maximum temperature of the year.
Write a program to read 12 temperature values from a file called temps.dat and determine which is the minimum and maximum temperature of the year.
Your program should validate if data can be read from the file if(inData). Use the statements if, else and while...e.g. if(counter==1), while(inFile>>inData), if(inData>max) and if(inData Your program output should display the data read from the file, followed by Min Temperature value and Max Temp value. Remember, determine smallest and largest with the assumption that the first item is the smallest and largest. Then test all other elements against those.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
