// Miya Natsuhara // 07-15-2019 // CSE142 // TA: Grace Hopper // A short program to report the grade determination of a user after applying a simple curve to the // score they input. import java.util.*; public class GradeDetermination { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.print("What percentage did you earn? "); double percentage = console.nextDouble(); percentage = curveUp(percentage); if (percentage >= 90) { System.out.println("You got an A!"); } else if (percentage >= 80) { // know that percentage >= 90 was false System.out.println("You got an B!"); } else if (percentage >= 70) { // know that percentage >= 80 was false System.out.println("You got an C!"); } else if (percentage >= 60) { System.out.println("You got an D!"); } else { System.out.println("You got an F!"); } } // Applies a simple curve to the given overall percentage and returns the curved grade. // percent: the overall percentage before curving public static double curveUp(double percent) { System.out.println("old percent: " + percent); int curve; if (percent < 50) { int curve = 10; } else { int curve = 5; } percent += curve; System.out.println("percent after curve: " + percent); return percent; } }