Question: Java please Code from previous question import java.util.Arrays; import java.util.Scanner; public class Q2 { private static int MedianScore(int[] scores) { int[] temp = Arrays.copyOf(scores, scores.length);

Java please

Java please Code from previous question import java.util.Arrays; import java.util.Scanner; public class

Q2 { private static int MedianScore(int[] scores) { int[] temp = Arrays.copyOf(scores,

Code from previous question

import java.util.Arrays; import java.util.Scanner;

public class Q2 { private static int MedianScore(int[] scores) { int[] temp = Arrays.copyOf(scores, scores.length); Arrays.sort(temp); int n = temp.length; if (n % 2 == 1) { return temp[n / 2]; } else { int first = temp[(n - 1) / 2]; int second = temp[n / 2]; return (first + second) / 2; } }

public static void main(String[] args) { Scanner sc = new Scanner(System.in); String name = sc.nextLine(); String bannerNumber = sc.nextLine();

int Tests, PoDs, Assignments, Practicums, Labs; Tests = sc.nextInt(); PoDs = sc.nextInt(); Assignments = sc.nextInt(); Practicums = sc.nextInt(); Labs = sc.nextInt();

double finalScoreTotal = (0.28 * Tests) + (0.10 * PoDs) + (0.28 * Assignments) + (0.24 * Practicums) + (0.105 * Labs); float final1 = (float) finalScoreTotal;

int[] scores = {Tests, PoDs, Assignments, Practicums, Labs}; System.out.printf("Hi %s (%s), based on the input given: Tests= %d%s PoDs= %d%s, Assignments= %d%s, Practicums=%d%s, Labs=%d%s, " + "your final score is %.2f%s with a median of %d%s.", name, bannerNumber, Tests, "%", PoDs, "%", Assignments, "%", Practicums, "%", Labs, "%", final1, "%", MedianScore(scores), "%"); } }

Problem 3 - Predictions Modify your program to calculate the highest possible score, mean and median, (i.e. the score possible if the student were to get 100% on all marking schemes hereafter) given user input of current scores. For full marks, the solution will need to calculate the average of N numbers. The user will first input an int specifying how many numbers they will be entering for the computation. For example, if the user wants to enter only the Tests and Pods scores, they will need to specify '2'. You will then assume all other (assignments, practicums, pods) scores are 100 The order of entry remains Tests, PoD, Assignments, Practicum, Labs. So, the program is limited to accepting items in that order. Bonus Objective (not for marks), after completing this question modify your code to better serve you and your progress in the course (e.g. accepting more information, different ordering, flexibility of input). Input Student name (String) Banner number (String) Number of learning objectives completed (int) Marks on each assessment (int) in order of Tests, POD, Assignments, Practicum, Labs Output Pretty printed report as exemplified below The final score should be printed with two decimals points (double) Median (int) . Example: Input Anon Ymous B00900900 5 80 90 Output Hi Anon Ymous (B00900900), based on the input given for 5/5 scores: Tests= 80% PODs= 90%, Assignments= 70%, Practicums=40%, Labs=50%, your final score is 65.85% with a median of 70%. 70 40 50 Anon Ymous 00900900 1 80 Anon Ymous 00900900 2 80 Hi Anon Ymous (00900900), based on the input given for 1/5 scores: Tests 80% Pods= 100%, Assignments 100%, Practicums=100%, Labs=100%, your final score is 94.90% with a median of 100%. Hi Anon Ymous (00900900), based on the input given for 2/5 scores: Tests= 80% PoDs= 90%, Assignments= 100%, Practicums=100%, Labs=100%, your final score is 93.90% with a median of 100%. Oo O 90

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem we need to modify the given Java program to calculate the highest possible score mean and median based on the input scores and c... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!