Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a pseudocode algorithm (not actual C++ code) whose purpose is to find the

ID: 664679 • Letter: W

Question

Write a pseudocode algorithm (not actual C++ code) whose purpose is to find the maximum, minimum and sum for a collection of numbers. To practice the concepts of local scope, references, and functions, your pseudocode will have the following:
   o A main function that asks the user for ten marks
   o A function named findMinandMaxSum that finds the lowest and highest of all the marks, and the sum of all elements and returns them through reference parameters. This function cannot display or print anything!
   o Your main function call findMinandMaxSum to obtain the three values, and then print them.
You must write complete algorithm including the algorithm header and algorithm body

Explanation / Answer

Pseudocode:

start
Declarations
        num SIZE=10
        num marks[SIZE]
        num min
        num max
        num sum
        num i
      
test=findMinandMaxSum()

       output test.min,test.max,test.sum
stop

findMinandMaxSum()
      min=0
      max=0
      sum=0
      i=0
      Check (i<10) then
         if(i==0) then
           min=marks[i]
           max=marks[i]
        end if
         if(marks[i]>max)
             max=marks[i]
         end if
         if(marks[i]<min)
             min=marks[i]
             sum=sum+marks[i]
         end if
return max, min,sum

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote