Está en la página 1de 2

package poo.

alumnos;

public class Alumno


{
String nombre;
String Direccion;
String Carrera;
double Semestre;
double PromedioG;

public Alumno(String nombre, String Direccion, String Carrera, double Semestre, double PromedioG)
{
this.nombre = nombre;
this.Direccion = Direccion;
this.Carrera = Carrera;
this.Semestre = Semestre;
this.PromedioG = PromedioG;
}

package poo.alumnos;

import java.util.Scanner;

public class PrbAlumnos


{

public static void main(String[] args)


{
Scanner sc = new Scanner(System.in);
String nombre = "", direccion = "", carrera = "";
double semestre = 0, promedioG = 0;
System.out.println("Ingrese Nombre: ");
nombre = sc.nextLine();
System.out.println("Ingrese Direccion: ");
direccion = sc.nextLine();
System.out.println("Ingrese Carrera: ");
carrera = sc.nextLine();
System.out.println("Ingrese Semestre: ");
semestre = sc.nextDouble();
System.out.println("Ingrese Promedio General: ");
promedioG = sc.nextDouble();
Alumno alumno = new Alumno(nombre, direccion, carrera, semestre, promedioG);
System.out.println("Datos Guardados...");
System.out.println("---------------------------------");
System.out.println("Consulta de Datos");
System.out.println("Nombre de Alumno: "+alumno.nombre);
System.out.println("Direccion de Alumno: "+alumno.Direccion);
System.out.println("Carrera de Alumno: "+alumno.Carrera);
System.out.println("Semestre de Alumno: "+alumno.Semestre);
System.out.println("Promedio General de Alumno: "+alumno.PromedioG);
}
}

Guardado:

Consulta:

También podría gustarte