Question: using C Programming Question 1 You inherited the following codes from a previous programmer in your position. 1: #include 2: 3: int main(void) 4: K

using C Programming using C Programming Question 1 You inherited the following codes from a

Question 1 You inherited the following codes from a previous programmer in your position. 1: #include 2: 3: int main(void) 4: K 5: int voltage = {2, 4, 8, 7, 9}; 6: int current = {1, 4, 3, 8} 7: int p = &current(2): 8: 9: printf("The average voltage is : "); 10: 11: 10: printf("%d". p); 11: 12: return 0; 13: 14: a) Analyse and modify the program to generate the average value of the voltage and evaluate line 9 using a programming software. Ensure that your program is general enough such that the code is still relevant even if each value and the number of voltage reading changes (more or less than five readings). (5 marks) b) Design a function to calculate the median (middle value of a series of numbers) of the current and print out the value using a programming software. (7 marks) c) Suggest the possible printouts of the output of line 10. Explain your answer. (3 marks) [15 marks] Question 1 You inherited the following codes from a previous programmer in your position. 1: #include 2: 3: int main(void) 4: K 5: int voltage = {2, 4, 8, 7, 9}; 6: int current = {1, 4, 3, 8} 7: int p = &current(2): 8: 9: printf("The average voltage is : "); 10: 11: 10: printf("%d". p); 11: 12: return 0; 13: 14: a) Analyse and modify the program to generate the average value of the voltage and evaluate line 9 using a programming software. Ensure that your program is general enough such that the code is still relevant even if each value and the number of voltage reading changes (more or less than five readings). (5 marks) b) Design a function to calculate the median (middle value of a series of numbers) of the current and print out the value using a programming software. (7 marks) c) Suggest the possible printouts of the output of line 10. Explain your answer. (3 marks) [15 marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!