# Need help with Methods!

• March 29th, 2013, 11:33 PM
ViewtifulAaron
Need help with Methods!
Hi there, so I'm basically lost on how to get Methods to work properly. Any help you could give me is greatly appreciated! I also attached a file with the requirements to do this project, so if you could take a look at that and tell me what you think, I would be very thankful!

Code java:

```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 orgGrade(double orgGrade); //get users grade.   clearScreen(); //clear the screen   a = Menu(int a); //show menu/selections     if (a == 1) newGrade = orgGrade + points; System.out.print("Curve applied: " + points); System.out.print("Adjusted grade: " + newGrade); else if (a == 2) newGrade = (orgGrade * percent) + orgGrade; gradePercent = orgGrade * percent; System.out.print("Curve applied: " + gradePercent); System.out.print("Adjusted grade: " + newGrade); else if (a == 3) 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); else if (a == 4) 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); else if (a >= 5) System.out.print("That is not valid a selection!");                     } 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); double orgGrade;     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) { int a; Scanner keyboard = new Scanner(System.in);   System.out.print(" Grade Aduster"); System.out.print(" by Aaron Webster \n"); // Greet user System.out.print("******************************"); 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 }```
• March 30th, 2013, 04:09 AM
barhoom
Re: Need help with Methods!
You have a lot of mistakes in your program, I will go through 1 method and you figure the rest.

Correction:
First: your method name should be the same in the method call and the method.
Second: you have typed the type (double) of orgGrade in the method call which is wrong.