import static void giveintro() { System.out.println(“This program reads

import java.util.*;public class Gradanator { public static void main(String args) {    giveintro(); Scanner console = new Scanner(System.in); double Midterm = Testscore(“Midterm”, console); double Final = Testscore(“Final”, console); double Homework = Homeworkscore(console); Overallgrade(Midterm, Final, Homework); }    public static void giveintro() { System.out.println(“This program reads exam/homework scores”); System.out.println(“and reports your overall course grade.”); System.out.println(); }    public static double Testscore(String test, Scanner console) { final int max = 100;      System.out.println(test + “: “); 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 shifted = console.nextInt(); if (shifted == 1){ System.out.print(“Shift amount? “); int shiftamount = console.nextInt();         score += shiftamount; } if (score >= max) {         score = max;      } else {         score = Math.min((int) score, (int) max);      } System.out.println(“Total points = ” + score + ” / ” + max); double shiftedscore = shiftedscore(score, weight, max); System.out.printf(“Weighted score = %.1f / ” + weight + ”

“, shiftedscore, weight); return shiftedscore; }      public static double shiftedscore(int testscore, int testweight, final int max){ return (double)testscore / (double)max * (double)testweight; } public static double Homeworkscore(Scanner console) { final int maxsectionpoint = 30;      final int pointpersection = 5;      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 orimaxscore = 0; int oriscore = 0; for(int i = 0; i <= numofassignments - 1; i++) { System.out.print("Assignment " + (i+1) + " score and max? "); int score = console.nextInt(); int totalscore = console.nextInt(); orimaxscore += totalscore;         oriscore += score; } System.out.print("How many sections did you attend? "); int sections = console.nextInt(); int sectionpoint = Math.min((sections * pointpersection), maxsectionpoint); System.out.println("Section points = " + sectionpoint + " / " + maxsectionpoint); orimaxscore += maxsectionpoint;      oriscore += sectionpoint; oriscore = Math.min(oriscore, orimaxscore); System.out.println("Total points = " + oriscore + " / " + orimaxscore); double shiftedscore = shiftedscore(oriscore, weight, orimaxscore); System.out.printf("Weighted score = %.1f / " + weight + " ", shiftedscore, weight); return shiftedscore; }    public static void Overallgrade(double Midterm, double Final, double Homework){ double percentage = Midterm + Final + Homework; System.out.printf("Overall percentage = %.1f ", percentage); double GPA; String s; if (percentage >= 85){ GPA = 3.0; s = “Good Job”; } else if  (percentage >= 75) { GPA = 2.0; s = “Nice”; } else if  (percentage >= 60) { GPA = 0.7; s = “It’s alright”; } else { GPA = 0.0; s = “Please drop this class”; } System.out.printf(“Your grade will be at least: %.1f
“, GPA); System.out.println(s); }   }

Best services for writing your paper according to Trustpilot

Premium Partner
From $18.00 per page
4,8 / 5
4,80
Writers Experience
4,80
Delivery
4,90
Support
4,70
Price
Recommended Service
From $13.90 per page
4,6 / 5
4,70
Writers Experience
4,70
Delivery
4,60
Support
4,60
Price
From $20.00 per page
4,5 / 5
4,80
Writers Experience
4,50
Delivery
4,40
Support
4,10
Price
* All Partners were chosen among 50+ writing services by our Customer Satisfaction Team