Question: 5. Your next exercise is to write a program to read a sequence of values and add them to an array. You will then

5. Your next exercise is to write a program to read a sequence of values and add them to an array. You will then find the largest and the smallest values of the array, print them to the screen, and print the content of the array. SIT232 Object-Oriented Development Continue with the current project and follow the instructions to implement your program. Create a one-dimensional double data type array of length 10. - Create a currentSize variable of type int and initialise it to zero. - Create two variables of type double named current Largest and currentSmallest. 3 Trimester 1, 2023 Using these variables, write code to read input from the console and print the array. Then add code to find the largest value by implementing the following instructions: - Assign to the variable currentLargest the value stored at the first position in the array. - Use a for loop to iterate through the array. In the for loop, use an if statement to compare the current element of the array to the value held by the current Largest variable. If the current element is greater than the current Largest, assign its value to the current Largest. In the for loop, print out each element of the array. - Print the largest value of the array to the console. Similarly, find the smallest value stored in the array. Compile, run and check the program for potential errors.
Step by Step Solution
There are 3 Steps involved in it
c include stdio h int main double arr10 int currentSize 0 double cur... View full answer
Get step-by-step solutions from verified subject matter experts
