Question
java please code from previous question import java.util.Scanner; public class Q1{ public static void main(String [] args){ /*In this section of the program we will
java please
code from previous question
import java.util.Scanner; public class Q1{ public static void main(String [] args){ /*In this section of the program we will be using a scanner class to allow the user to input information*/ Scanner in = new Scanner(System.in); String studentName = in.nextLine(); String bannerNumber = in.nextLine(); int tests = in.nextInt(); int pods = in.nextInt(); int assignments=in.nextInt(); int practicums = in.nextInt(); int labs = in.nextInt();
double finalScore=0; double testsFinal = tests * 0.28; double podsFinal = pods * 0.10; double assignmentsFinal = assignments * 0.28; double practicumsFinal = practicums * 0.24; double labsFinal = labs * 0.105; finalScore = testsFinal + podsFinal + assignmentsFinal + practicumsFinal + labsFinal;
System.out.print("Hi " + studentName + " (" +bannerNumber + ")"+ ", " +"based on the input given: "+ "Tests= " + tests+"% " + "PoDs= "+ pods + "%, " + "Assignments= " + assignments + "%, " + "Practicums=" + practicums + "%, " + "Labs="+ labs + "%, " + "your final score is ");
System.out.printf("%.2f", finalScore ); System.out.print("%."); } }
Problem 2 - Computing Medians Modify your program to use a method (helper functions) to calculate the median score. The method should receive an array (or list) of the grades. If you don't use arrays (or lists) you will receive a zero on this problem. The median is defined as "a value in an ordered set of values below and above which there is an equal number of values or which is the arithmetic mean of the two middle values if there is no one middle number." The wiki has more info on it: https://en.wikipedia.org/wiki/Median Your method will receive the array (or list) create a copy of it and then sort it so you can compute the median. If you are on Java, you can use the Arrays class to help you with these operations. Input Student name (String) Banner number (String) Marks on each assignment (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 80 Output Hi Anon Ymous (B00900900), based on the input given: Tests= 80% PODs= 90%, Assignments= 70%, Practicums=40%, Labs=50%, your final score is 65.85% with a median of 70%. 90 70 40 50
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started