I posted a question last night about making a grad calculator while using methods in java (netbeans) I'm still really struggling and wondering if anyone can help me with my code below? We have to make a grade calculator and take inputs from the user for their test mark, the max mark possible for that test, and the weighting. Eg. 30/50 *50% = overall weighted mark. I have to use methods but I'm still so confused about parameters and where to put the user input part. Any help would be greatly appreciated!
import java.util.Scanner;
public class GradeCalculator {
public static void main()
{
System.out.println("Your overall score is: " +CalculateMark(finalMark));
}
public static double CalculateMark (int overallscore)
{
Scanner in = new Scanner(System.in);
int score1 = in.nextInt();
System.out.print("Enter mark: ");
if(score1 >=0 || score1<1000){
} System.out.print("Enter Max mark: ");
int maxMark = in.nextInt();
if (maxMark >=0 || maxMark<1000);{
} System.out.print("Enter weighting as a decimal (eg. 75% = 0.75): ");
double weighting = in.nextDouble();
if (weighting <0 && weighting>=10){
} double finalMark;
finalMark= (score1/maxMark)*weighting;
return finalMark;
}
}