Ok, so I keep on getting the errors where it says my variable may not have been initialized. I get this error in lines 22 regarding orgGrade, 26 regarding variable 'a', 33 regarding newGrade, 37 regarding newGrade and gradePercent, 41 regarding newGrade and gpoints, 45 regarding newGrade and gpercent. Any reason that is obvious that I'm missing?
import java.util.Scanner; //for the ability to get input from //the keyboard import java.text.DecimalFormat; public class Project3 { public static void main(String[] args) { //enter variable below double orgGrade; //Variable for the Original Grade double newGrade; //Variable for the Grade after the Curve double gradePercent; //Variable for displaying the percentage from option 4. double points = 10.0; //Variable for points added double percent = .10; //Variable for given percentage double gpoints; //Variable for the Given points double gpercent; //Variable for the Given percentage int a; // Variable for Menu Selection Scanner keyboard = new Scanner(System.in); DecimalFormat df = new DecimalFormat("00.0"); //start program here orginalgrade(orgGrade); //get users grade. clearScreen(); //clear the screen Menu(a); //show menu/selections System.out.print(a + orgGrade); switch (a) { case '1': addPoints(newGrade, orgGrade, points); break; case '2': addPercent(newGrade, orgGrade, percent, gradePercent); break; case '3': givenPoints(newGrade, orgGrade, gpoints); break; case '4': givenPercent(newGrade, orgGrade, gpercent); break; case '5': System.out.print("That is not valid a selection!"); break; } }//end main public static void clearScreen() { System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); }//end clearScreen public static void freezeScreen() { Scanner keyboard = new Scanner(System.in); System.out.print(" -- Press Enter to Continue --"); keyboard.nextLine(); }//end freezeScreen public static double orginalgrade(double orgGrade) { Scanner keyboard = new Scanner(System.in); System.out.println("What is the original grade?"); //Get original grade from user orgGrade = keyboard.nextDouble(); return orgGrade; }//end orgGrade public static int Menu(int a) { Scanner keyboard = new Scanner(System.in); System.out.println(" Grade Aduster"); System.out.println(" by Aaron Webster "); // Greet user System.out.println("******************************\n"); System.out.println("1. Curve by 10 points."); //menu options here System.out.println("2. Curve by 10 percent."); System.out.println("3. Curve by a certain number of points."); System.out.println("4. Curve by a given percentage"); System.out.println("5. Exit program\n"); System.out.println("Enter your selection here"); a = keyboard.nextInt(); return a; }//end Menu public static double addPoints(double newGrade, double orgGrade, double points) { newGrade = orgGrade + points; System.out.print("Curve applied: " + points); System.out.print("Adjusted grade: " + newGrade); return newGrade; }//end addPoints public static double addPercent(double newGrade, double orgGrade, double percent, double gradePercent) { newGrade = (orgGrade * percent) + orgGrade; gradePercent = orgGrade * percent; System.out.print("Curve applied: " + gradePercent); System.out.print("Adjusted grade: " + newGrade); return newGrade; }//end addPercent public static double givenPoints(double newGrade, double orgGrade, double gpoints) { Scanner keyboard = new Scanner(System.in); System.out.print("How many points should be applied to curve the grade?"); gpoints = keyboard.nextDouble(); newGrade = gpoints + orgGrade; System.out.print("Curve applied: " + gpoints); System.out.print("Adjusted grade: " + newGrade); return newGrade; }//end givenPoints public static double givenPercent(double newGrade, double orgGrade, double gpercent) { Scanner keyboard = new Scanner(System.in); System.out.print("Enter the percentage of the curve. (Ex. 10% would be .10)"); gpercent = keyboard.nextDouble(); newGrade = (gpercent * orgGrade) + orgGrade; System.out.print("Curve applied: " + gpercent); System.out.print("Adjusted grade: " + newGrade); return newGrade; }//end givenPercent }