Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

# Thread: Need help with Methods!

1. ## 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!

```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 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

clearScreen(); //clear the screen

if (a == 1)
System.out.print("Curve applied: " + points);
else if (a == 2)
else if (a == 3)
System.out.print("How many points should be applied to curve the grade?");
gpoints = keyboard.nextDouble();
System.out.print("Curve applied: " + gpoints);
else if (a == 4)
System.out.print("Enter the percentage of the curve. (Ex. 10% would be .10)");
gpercent = keyboard.nextDouble();
System.out.print("Curve applied: " + gpercent);
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

{
Scanner keyboard = new Scanner(System.in);

{
int a;
Scanner keyboard = new Scanner(System.in);

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");
a = keyboard.nextInt();

return a;

public static
}```

2. ## 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.