Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package nota;
- import java.util.Scanner;
- public class Nota {
- public static void main(String[] args) {
- int y = 0;
- double acum = 0;
- double media = 0;
- double maiormedia = 0;
- int maiorposicao = 0;
- String[] nomes = new String[3];
- double[][] notas = new double[3][3];
- for (int i = 1; i < nomes.length; i++) {
- System.out.println("Aluno: " + i);
- nomes[i] = (new Scanner(System.in)).nextLine();
- for (int j = 0; j < 3; j++) {
- System.out.println("Digite sua nota: " + j);
- notas[i][j] = (new Scanner(System.in)).nextDouble();
- acum = acum + notas[i][j];
- }
- media = acum / 3;
- if (media > maiormedia) {
- maiormedia = media;
- maiorposicao = i;
- }
- System.out.println("A maior média foi" + maiormedia + "do aluno" + nomes[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement