Question: C++ Coding/Pointers - #9 B Option Create a program to record temperatures and find the lowest, highest and average temperature. .Create one dimensional float arrays
C++ Coding/Pointers - #9

B Option Create a program to record temperatures and find the lowest, highest and average temperature. .Create one dimensional float arrays in the function main) called temps Best possible grade is 90% const int MAXTEMPS=10; float temps [MAXTEMPS]; . Write a loop to ask the user to enter the temperatures until MAXTEMPS is reached. . Calculate and display the average temperature from the array .Find the highest and lowest temperatures in the array and print them out. A Option Do the B option and Best possible grade for the A option is 100% : Use pointers to point at the highest and lowest temperatures in the array. Use pointers instead of the method used in the B option. .Create three pointer variables float float float pCur; pHigh; pLow: // current location in the array // points at highest temp in the array // points at lowest temp in the array Point pCur at the start of the array pCurtemps; .Point pHigh and pLow to the start of the array as well. * Step the pCur through the array using a for loop (Use pcur+ to step it through the array.) .Loop through the array looking for the high and low temperatures. . Ifa lower temperature is found, have pLow point at that element in the array if pCur
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
