import double finalexam, double homework){ double percentage =

import java.util.*;public class Gradanator1 { final int MAX = 100; public static void main(String args) { Scanner console = new Scanner(System.in); intro(); double midterm = calcTest(“Midterm”, console, 100); double finalexam = calcTest(“Final”, console, 100); double homework = calcHomework(console); reportGrade(midterm, finalexam, homework); } //introduce users to the program public static void intro() { System.out.println(“This program reads exam/homework scores”); System.out.println(“and reports your overall course grade.”); System.out.println(); } //ask the user what test they took //goes through a diffrent test depending if they clicked 1 or 2 public static double calcTest(String testType, Scanner console, int MAX) { System.out.println(testType + “: “); System.out.print(“Weight (0-100)? “); int weight = console.nextInt(); System.out.print(“Score earned? “); int score = console.nextInt(); System.out.print(“Were scores shifted (1=yes, 2=no)? “); int scoreShift = console.nextInt(); if (scoreShift == 1){ System.out.print(“Shift amount? “); int shiftscore = console.nextInt(); score += shiftscore; } else { score = Math.min(score, MAX); } System.out.println(“Total points = ” + score + ” / ” + MAX); double weightedScore = getWeightedScore(score, weight, MAX); System.out.printf(“Weighted score = %.1f / %d

“, weightedScore, weight); return weightedScore; } public static double calcHomework(Scanner console) { final int MAX_SECTION_POINTS = 20; final int POINTS_PER_SECTION = 3; System.out.println(“Homework:”); System.out.print(“Weight (0-100)? “); int weight = console.nextInt(); System.out.print(“Number of assignments? “); int numOfAssignments = console.nextInt(); int accumulatedMax = 0; int accumulatedScore = 0; for(int i = 0; i = 85){ minGrade = 3.0; message = “You did excellent”;      } else if { (percentage >= 75) minGrade = 2.0; message = “You did good”; } else if { (percentage >= 60; minGrade = 0.7; message = “You did not do so well”; } else { minGrade = 0.0; message = “You need some work”; } System.out.printf(“Your grade will be at least: %.1f
“, minGrade); System.out.println(message); } public static double getWeightedScore(int score, int weight, final int MAX_SCORE){ return ((double)score / (double)MAX_SCORE) * (double)weight; }}

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now
x

Hi!
I'm Mack!

Would you like to get a custom essay? How about receiving a customized one?

Check it out