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

Which of the following require saving all the values from standard input (in an

ID: 3650618 • Letter: W

Question

Which of the following require saving all the values from standard input (in an array, say), and which could be implemented as a filter using only a fixed number of variables? For each, the input comes from standard input and consists of N real numbers between 0 and 1.

Print the maximum and minimum numbers.
Print the kth smallest value.
Print the sum of the squares of the numbers.
Print the average of the N numbers.
Print the percentage of numbers greater than the average.
Print the N numbers in increasing order.
Print the N numbers in random order.

We have been using StdIn.readInt(), StdIn.isEmpty() so maybe it is useful here?

Explanation / Answer


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