I'm trying to make a program, which gives the grade of two tests, P1 and P2. You add and divide by 2 to get the average. If it is greater than 6, the program returns the following sentence: Approved . If the average is less than 4, the program returns the following sentence: Disapproved . Now, if the grade is between 4 and 6, the program asks for the grade of the proof of recovery (VS), and if it is greater than 6, it returns: Approved , or if the grade is smaller which 6 returns: Disapproved .
I wanted to ask for help, where I went wrong with the problem.
Note: I can not use Scanner. I have to keep this anyway, but I can not run the program.
class Media {
public static double Media( float P1, float P2) {
double Media = (P1 + P2) / 2;
}
public static double VS( float nota) {
double VS = nota;
}
public static void main(String [] args) {
if (Media >= 6) {
System.out.println("Aprovado.");
}
else if (Media < 4) {
System.out.println("Reprovado.");
}
else {
if( nota >= 6) {
System.out.println("Aprovado.");
}
else {
System.out.println("Reprovado.");
}
}
}
}