Question: Write a program to calculate the minimum, maximum, mean, median, mode, and whether a vector is a palindrome. Note: This program is designed for incremental
Write a program to calculate the minimum, maximum, mean, median, mode, and whether a vector is a palindrome.
Note: This program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.
Step Review the starter code in main A vector is filled with integers from standard input. The first value indicates how many numbers are to follow and be placed in the vector.
Step pts Use a loop to process each vector element and output the minimum and maximum values. Submit for grading to confirm one test passes.
Ex: If input is:
the output is:
Minimum: Maximum:
Step pts Use a loop to sum all vector elements and calculate the mean or average Output the mean with one decimal place using cout fixed setprecision; once. Submit for grading to confirm two tests pass.
Ex: If input is:
the output is:
Minimum: Maximum: Mean:
Step pts Use a loop to determine if the vector is a palindrome, meaning values are the same from front to back and back to front. Output "true" or "false". Submit for grading to confirm three tests pass.
Ex: If input is:
the output is:
Minimum: Maximum: Mean: Palindrome: true
Step pt main includes a call to sort which sorts the vector elements into ascending order. Do not sort the vector before step After sorting, identify the median. The median is located in the middle of the vector if the vector's size is odd. Otherwise, the median is the average of the middle two values. Output the median with one decimal place. Submit for grading to confirm four tests pass.
Ex: If input is:
the output is:
Minimum: Maximum: Mean: Palindrome: false Median:
Step pts Challenging! Identify the mode after the vector is sorted in ascending order. The mode is the value that appears most frequently. Assume only one mode exists. Hint: Use a loop to process each vector element, looking for the longest sequence of identical values. Submit for grading to confirm all tests pass.
Ex: If input is:
the output is:
Minimum: Maximum: Mean: Palindrome: false Median: Mode:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
