I'm new in java I was practicing conditional and I wanted to do it more interactive but I have a problem and I think it has to do with the Scanner class it happens that the second time that he asks to enter the name and the score shows it in a single line and if I put a name and then a number that error comes out here I leave the code
package Capitulo_4;
//importacion
import java.util.Locale;
import java.util.Scanner;
public class PruebaEstudiante {
public static void main(String[] args) {
//VARIABLES LOCALES
String name;
double puntos;
//CREACION E INSTANCIAMIENTO DE OBJETOS DE LA CLASE ESTUDIANTE
Estudiante cuenta1 = new Estudiante("joel", 16.25);
Estudiante cuenta2 = new Estudiante("lesley", 100.00);
Scanner entrada = new Scanner(System.in).useLocale(Locale.US);
//IMPRIMIR
System.out.print("ingrese su nombre: ");
name = entrada.nextLine();
System.out.print("ingrese el puntaje obtenido: ");
puntos = entrada.nextDouble();
cuenta1.establecerNombre(name);
cuenta1.establecerPromedio(puntos);
System.out.printf("Registrando datos de la cuenta1 %n%s%s%n%s%.2f%n%n",
" >ingresando nombre: ",cuenta1.obtenerNombre(),
" >ingresando puntaje : ",cuenta1.obtnerPromedio());
System.out.print("ingrese su nombre: ");
name = entrada.nextLine();
System.out.print("ingrese el puntaje obtenido: ");
puntos = entrada.nextDouble();
cuenta2.establecerNombre(name);
cuenta2.establecerPromedio(puntos);
System.out.printf("Registrando datos de la cuenta2 %n%s%s%n%s%.2f%n%n",
" >ingresando nombre: ",cuenta2.obtenerNombre(),
" >ingresando puntaje : ",cuenta2.obtnerPromedio());
System.out.printf("La calificacion en letra de %s es : %s%n",cuenta1.obtenerNombre(),cuenta1.obtenerCalificación());
System.out.printf("La calificacion en letra de %s es : %s%n",cuenta2.obtenerNombre(),cuenta2.obtenerCalificación());
}
}
I can leave a picture so you can see the error that comes out