Question: Write a program to read in a list of integers, and print out the first quartile (lowest 1/4 of the values), then the second quartile
Write a program to read in a list of integers, and print out the first quartile (lowest 1/4 of the values), then the second quartile (the next 1/4 of the values), then the third quartile, and finally the fourth quartile. For example, if the input is
1 4 3 6 2 8 7 5
the output should be
First quartile: 1 2 Second quartile: 3 4 Third quartile: 5 6 Fourth quartile: 7 8
You should use integer division to computer the quarter boundaries; thus, the input
1 3 4 5 2
should produce this output:
First quartile: 1 Second quartile: 2 Third quartile: 3 Fourth quartile: 4 5
Note: Code in C++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
