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

The next Winter Olympics is two years away, but the International Olympic Commit

ID: 3581739 • Letter: T

Question

The next Winter Olympics is two years away, but the International Olympic Committee (IOC) wants you to develop a computer system that will determine the trimmed or truncated mean of the scores from a judging panel used for Olympic skating events. The specific truncated mean that the IOC requires is the average of the remaining scores, after the lowest and highest scores have been discarded. Your solution can assume there are seven judges, and the final result will be the average of the five middle scores. The system architect for this project has produced a high-level design by functionally decomposing the overall task into the following mainline and major subtasks:

Explanation / Answer

//module getScores, returns array, does not need input
getScores()
   declare array scores[7]
   loop, 7 times from loopIndex = - to 6
       print enter score by judge (loopIndex+1)
       input scores[loopIndex]
   return scores
  
//module findMin, takes array as input, returns the minimum
findMin(scores)
   declare min = scores[0]
   loop, 6 times from loopIndex = 0 to 5
       if (score[loopIndex+1]<min)
           min = scores[loopIndex+1]
   return min

//module findMax, takes array as input, returns the maximum
findMax(scores)
   declare max = scores[0]
   loop, 6 times from loopIndex = 0 to 5
       if (score[loopIndex+1]>max)
           max = scores[loopIndex+1]
   return max

//module calculateTruncatedMean, takes array, min, max as input to return truncated mean
calculateTruncatedMean(scores, min, max)
   declare sum = 0
   loop, 7 times from loopIndex = 0 to 6
       if (scores[loopIndex]==max or scores[loopIndex]==min)
           continue
       else
           sum += scores[loopIndex]
   return sum/5

//module report, takes array and truncated mean as input
report(scores, truncatedMeanValue)
   loop, 7 times from loopIndex = 0 to 6
       print, score given by judge (loopIndex+1) is scores[loopIndex]
   print, truncated mean is truncatedMeanValue

//module mainline
mainLine()
   array scores = getScores()
   min = getMin(scores)
   max = getMax(scores)
   mean = calculateTruncatedMean(scores, min, max)
   report(scores, mean)

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