Skip to content

Instantly share code, notes, and snippets.

@Rafael11j
Created February 16, 2017 23:43
Show Gist options
  • Save Rafael11j/21f11c7aae3779c2d6c2fb6362b09731 to your computer and use it in GitHub Desktop.
Save Rafael11j/21f11c7aae3779c2d6c2fb6362b09731 to your computer and use it in GitHub Desktop.
package exercicícios;
import java.util.Scanner;
public class Exercício04 {
public static void main(String[] args) {
Scanner abre = new Scanner(System.in);
double n1, n2, n3, media;
System.out.println("Digite a primeira nota: ");
n1 = abre.nextDouble();
System.out.println("Digite a segunda nota: ");
n2 = abre.nextDouble();
System.out.println("Digite a terceira nota: ");
n3 = abre.nextDouble();
media = (n1 + n2 + n3)/3;
if(media >= 7){
System.out.println("Aprovado. Média: "+media);
}else if(media >= 5 && media < 7){
System.out.println("Recuperação. Média: "+ media);
}
else{
System.out.println("Reprovado. Média: "+ media);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment