Question: In Java Please Program Specifications Write a program to calculate the minimum, maximum, mean, median, mode, and whether an array is a palindrome. Note: This
In Java Please
Program Specifications Write a program to calculate the minimum, maximum, mean, median, mode, and whether an array 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 An array is filled with integers from standard input. The first value indicates how many numbers are to follow and be placed in the array.
Step pts Use a loop to process each array 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 array elements and calculate the mean or average Output the mean with one decimal place using System.out.printfMean: f
mean; 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 array 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 Arrays.sort which sorts the array elements into ascending order. Do not sort the array before step After sorting, identify the median. The median is located in the middle of the array if the array's length 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 array 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 array 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:
This is the current code I have up to step
import java.util.Arrays;
import java.util.Scanner;
public class LabProgram
public static void mainString args
Scanner scnr new ScannerSystemin;
int nums;
int count;
Step : Input array values
count scnrnextInt;
nums new intcount;
for int i ; i count; i
numsi scnrnextInt;
Step : Find and output minimum and maximum values
int min Integer.MAXVALUE;
int max Integer.MINVALUE;
double sum ;
forint num : nums
ifnum min
min num;
ifnum max
max num;
sum num;
System.out.printlnMinimum: min;
System.out.printlnMaximum: max;
Step : Calculate and output mean
System.out.printfMean: f
sum count;
Step : Check if palindrome
Sort array elements in ascending order
Arrays.sortnums;
Step : Find and output median
Type your code here
Step : Find and output mode
Type your code here
Thank you
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
