0

Temperature Records ( NEED HELP ) C language

This is the question Temperature Records Complete the program temperatures.c to store temperatures (ints) recorded over a period of time. The program should store the temperatures in a global array variable. Assume that the maximum number of temperatures that may be stored is 500. NOTE: All functions should be implemented with pointers. The only brackets present in your program should be for the array declaration. It is recommended that you implement functions one at a time. All averages should be rounded to one decimal point. Add the following functions to your program: - A function that finds the average of all temperatures stored. - A function that finds the average of the last 5 recorded temperatures. If there are less than 5 temperatures recorded, return the average of all recorded temperatures. - A function that records a new temperature. It must check if there is still space in the array. - A function that prints the number of temperatures recorded. - A function that prints all the temperatures recorded. Organize the program so the function prototypes are presented first, and the definitions after the main function. The main function is not allowed to have any scanf or printf function calls. Your program should ask the user to select an option from the following, and repeatedly ask them to choose an option until option (F) is selected: (A) Compute and print average of all temperatures, (B) Compute and print the average of the last five temperatures added, (C) Addanewtemperaturetothearray, (D) Print the number of temperatures recorded, (E) Printallthetemperaturesrecorded,or (F) Exit the program. Compile and test your program. See example inputs/outputs on the next page: Suppose I have already inputted 4 temperatures: [20, 21, 22, 23] Now I want to add 24, and try all the options: https://g.top4top.io/p_1918ozwzd0.png The options on this link please check it And This is my try.. https://code.sololearn.com/cgqzRHp8Tbs3 Help me please and write the correct code for me , as a

2nd Apr 2021, 2:47 AM
STOP
STOP - avatar
2 Respostas
0
Most of these errors looks like complaining about unnecessary spaces. I tried deleting spaces from two lines and errors are gone for these two. Try compiling this code in some other IDE if you have possibility to do so. By the way in add_new function, you declare int pointer 'q', which is not used
2nd Apr 2021, 3:20 AM
Michal Doruch
0
Michał Doruch check it now again https://code.sololearn.com/cgqzRHp8Tbs3
2nd Apr 2021, 3:22 AM
STOP
STOP - avatar