In: Computer Science
Design the logic for a program that has two parts.
Write this in pseudocode.
The pseudocode is as follows:
// The variables A (array of size 15), min, max, sum, average are initialized.
Declare A[15], min = 0, max = 0, sum = 0 average = 0
//Read the 15 elements in the array A
for
read(A[i])
// Let the first element of the array be the minimum and maximum element
min = A[0]
max = A[0]
// For each element in the array, if there exists any element which is less than the
// first element, it becomes the minimum element.
for
if A[i] < min
min A[i]
// For each element in the array, if there exists any element which is greater than the
// first element, it becomes the maximum element.
if A[i] > max
max A[i]
// Add all the elements of the array A
sum sum + A[i]
// Increment the counter
ii+1
// Compute the average by dividing the sum by 15
average = sum/ 15
//Print the maximum, minimum and average.
print max
print min
print average