Feito um novo exercicio com java usando Scanner
Scanner equivalente ao input do python
This commit is contained in:
		
							
								
								
									
										27
									
								
								exercicios-java/ControleDeNotas.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								exercicios-java/ControleDeNotas.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
import java.util.Scanner;
 | 
			
		||||
 | 
			
		||||
public class ControleDeNotas {
 | 
			
		||||
  public static void main(String[] args) {
 | 
			
		||||
    Scanner sc = new Scanner(System.in);
 | 
			
		||||
    System.out.print("Insira o nome do aluno: ");
 | 
			
		||||
    String nomedoaluno = sc.nextLine();
 | 
			
		||||
    System.out.print("Digite a primeira nota: ");
 | 
			
		||||
    double nota1 = sc.nextDouble();
 | 
			
		||||
    System.out.print("Digite a segunda nota: ");
 | 
			
		||||
    double nota2 = sc.nextDouble();
 | 
			
		||||
    System.out.print("Digite a terceira nota: ");
 | 
			
		||||
    double nota3 = sc.nextDouble();
 | 
			
		||||
 | 
			
		||||
    double media = (nota1 + nota2 + nota3) / 3;
 | 
			
		||||
 | 
			
		||||
    if (media >= 7) {
 | 
			
		||||
      System.out.println("O Aluno " + nomedoaluno + " está Aprovado");
 | 
			
		||||
    } else if (media < 7 || media >= 5) {
 | 
			
		||||
      System.out.println("O aluno " + nomedoaluno + " está em Recuperação");
 | 
			
		||||
    } else if (media < 5) {
 | 
			
		||||
      System.out.println("O aluno" + nomedoaluno + " está Reprovado");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    sc.close();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
public class Main {
 | 
			
		||||
public class Moedas {
 | 
			
		||||
 | 
			
		||||
  public static void main(String[] args) {
 | 
			
		||||
    final int Troco = 357;
 | 
			
		||||
		Reference in New Issue
	
	Block a user