Ajuda Exercicio com String!

package setimo_exercicio;
import java.util.Scanner;

/**
*

  • @author user
    */
    public class Main {

    /**

    • Faça um algoritmo em java para ler notas de 3 alunos e definir qual a

    • maior nota e o melhor aluno.
      */
      public static void main(String[] args) {
      // TODO code application logic here
      Scanner leia = new Scanner(System.in);
      double N1,N2,N3,MAIOR = 0;
      String ALUNO1 = new String();
      String ALUNO2 = new String();
      String ALUNO3 = new String ();
      String MELHOR = new String ();

      System.out.println("Informe nome e nota do 1ª aluno: ");
      ALUNO1 = leia.nextLine ();
      N1 = leia.nextDouble();

      MELHOR = ALUNO1;
      MAIOR = N1;

      System.out.println("Informe nome e nota do 2ª aluno: ");
      ALUNO2 = leia.nextLine ();
      N2 = leia.nextDouble();

      if ( N2 > MAIOR)

      {
      MELHOR = ALUNO2;
      MAIOR = N2;
      }

      System.out.println("Informe nome e nota do 3ª aluno: ");
      ALUNO3 = leia.nextLine ();
      N3 = leia.nextDouble();

      if (N3 > MAIOR)
      {
      MELHOR = ALUNO3;
      MAIOR = N3;
      }
      System.out.println("O melhor aluno é: " +MELHOR);
      System.out.println("E sua nota é : " +MAIOR );

    }

}

[color=red]ERRO.: [/color]
run:
Informe nome e nota do 1ª aluno:
Clayton
7,5
Informe nome e nota do 2ª aluno:
Marcella
Exception in thread “main” java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:840)
at java.util.Scanner.next(Scanner.java:1461)
at java.util.Scanner.nextDouble(Scanner.java:2387)
at setimo_exercicio.Main.main(Main.java:37)
Java Result: 1
CONSTRUÍDO COM SUCESSO (tempo total: 10 segundos)

realmente dá problemas…
vc tem algumas opções que eu conheço,

  • usar somente next() no lugar de nextLine();
  • intercalar os next’s com print’s, i.e:
entradaInteiro.nextInt();
System.out.println("Qualquer coisa");
entradaString.nextLIne();
System.out.println("Qualquer coisa");
  • usar a classe Console, presente no java 6 …
		Console leia;
		int N1, N2, N3, MAIOR = 0;
		String ALUNO1, ALUNO2, ALUNO3, MELHOR;

		System.out.println("Informe nome e nota do 1ª aluno: ");
		ALUNO1 = leia.readLine();
		N1 = Integer.parseInt(leia.readLine());

por que acontece…
poderá dar uma olhada aqui

http://forums.sun.com/thread.jspa?threadID=718569&messageID=4148209

demais links do GUJ semelhantes a sua duvida…

http://www.guj.com.br/posts/list/77982.java
http://www.guj.com.br/posts/list/79281.java

e outros


http://www.javafree.org/topic-865917-Ajuda-em-programa-Java-tipo-Histograma.html

é isso, []'s

Luciano