0
Guys, can someone help me out here.
I did a check of 3 notes inside a while.
I need that if 2 notes are equal a message Aluno1 and Aluno2 (Show only if the two typed notes are equal) Approved. I managed to do only with the highest note.
package calculo;
import java.util.Scanner;
public class Calculo {
public static void main(String[] args) {
float maior, num;
int count = 2;
Scanner entrada = new Scanner(System.in);
System.out.print("Nota Aluno 1: ");
num = entrada.nextFloat();
maior = num;
while(count <= 3){
System.out.print("Nota Aluno " + count + ": ");
num = entrada.nextFloat();
if(num > maior){
maior = num;
}
count++;
}
System.out.println("O maior numero digitado é: " + maior);
}
}
if(num == maior){ System.out.println("Aluno 1 e Aluno2")}
?– user28595
I tried this way but I did not succeed, like this problem runs like this, I type 3 notes, if I put 3, 4 and 5 the highest grade is approved that would be the 5, if I type 3 5 and 5 the two notes are approved. In the code it looks like this ("Student Note " + Count + ": ") it speaks which student is. If student 1 and student 2 are the same, it appears "Approved"
– Leonardo Macedo