I have to do a program that asks for the practical note and the theory note and calculates the final grade, the practical one is 30% and the theory 70%, a 5 is needed in the theory and a 5 in the theory. practice to do the average. I have done the program so what happens is that if I give a grade lower than 5, I add the notes but not the multiples by the percentages, then I always give the notes as approved.
import java.util.Scanner;
public class notes {
public static void main(String[] args) {
// TODO Auto-generated method stub
double notaPracticas=0;
double notaTeoria=0;
double notaFinal=0;
Scanner teclado=new Scanner(System.in);
System.out.println("Introduce tu nota de prácticas");
notaPracticas=teclado.nextDouble();
if (notaPracticas>=5) {
notaPracticas=notaPracticas*0.30;
System.out.println(notaPracticas);
} else if (notaPracticas<5) {
System.out.println("Nota incorrecta");
}
System.out.println("Introduce tu nota de teoría");
notaTeoria=teclado.nextDouble();
if (notaTeoria>=5) {
notaTeoria=notaTeoria*0.70;
System.out.println(notaTeoria);
}else if (notaTeoria<5)
System.out.println("Nota incorrecta");
notaFinal=notaPracticas+notaTeoria;
System.out.println(notaFinal);
}
}