Jump to content

POWERED BY:

reebr

Members
  • Content count

    778
  • Joined

  • Last visited

  • Days Won

    9

reebr last won the day on October 28 2015

reebr had the most liked content!

Community Reputation

94 Bom

5 Followers

About reebr

  • Birthday 06/20/1992

Informações Pessoais

  • Sexo
    Masculino
  • Localização
    Indaiatuba, SP

Contato

Recent Profile Visitors

4747 profile views
  1. reebr

    Exercícios Para Iniciantes

    Exercício 4: /* 4 - Escreva um programa para ler 3 notas diferentes de um aluno e informar * o valor da sua maior nota. * Altere este programa para informar também se a maior nota foi a * primeira, a segunda ou a terceira. * * INICIAR: * public class Main { public static void main (String args[]) { new E4(); } } */ import javax.swing.*; public class E4 extends JOptionPane { public E4() { init(); } private void init() { for (int i = 0; i < qtdNotas; i++) { nAtual = Float.parseFloat(showInputDialog(null, (i + 1) + " Nota: ")); if (i == 0) { nMaior = nAtual; maiorNota = i + 1; } else { if (nAtual > nMaior) { nMaior = nAtual; maiorNota = i + 1; } } } showMessageDialog(null, "Maior nota: " + nMaior + "\nA maior nota digitada foi a " + maiorNota + "."); } private final int qtdNotas = 3; private float nAtual, nMaior = 0; private int maiorNota; }
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.