Está en la página 1de 5

package pagobus;

public class Pagobus {

private String nombre;

private String material;

private int numeroSerie;

public String color;

public String tipodePagobus;

public Pagobus(){

public Pagobus(String nombre, String material, int numeroSerie, String color, String
tipodePagobus){

setNombre(nombre);

setMaterial(material);

setNumeroSerie(numeroSerie);

setColor(color);

setTipodePagobus(tipodePagobus);

public void setNombre(String nombre){

this.nombre = nombre;

public void setMaterial(String material){

this.material = material;

public void setNumeroSerie(int numeroSerie){

this.numeroSerie = numeroSerie;

public void SetColor(String color){

this.color = color;

public void setTipodePagobus(String tipodePagobus){


this.tipodePagobus = tipodePagobus;

public String getNombre(){

return this.nombre = nombre;

public String getMatetrial(){

return this.material = material;

public int getNumeroSerie(){

return this.numeroSerie = numeroSerie;

public String getColor(String color1){

return this.color = color;

public String getTipodePagobus(){

return this.tipodePagobus = tipodePagobus;

// Metodos (Lo que hace)

public void Pagar (){

System.out.println("Haz pagado tu pasaje");

public void ConsultarSaldo(){

System.out.println("Tu saldo Actual es de:$");

public void Romper (){

System.out.println("Tu pagobus no esta roto");

public void recargarpagobus(){

System.out.println("¡Haz recargado exitosamente!");


}

public void Expirar(){

System.out.println("¡Tu pagobus a expirado!");

public void Renovar(){

System.out.println("¡Haz Renovado Exitosamente tu Pagobus!");

private void setColor(String color) {

throw new UnsupportedOperationException("Not supported yet."); //To change body of


generated methods, choose Tools | Templates.

}
Esta Parte , creas otra hoja en neatbeans y
la copias :
package Pagobus;
import java.util.Scanner;
public class pagobuses {
public static void main(String[] args) {
String nombre, tipodePagobus, material,color;
int numeroSerie;
byte opcion = 0;
double cantidad = 0;
Scanner teclado = new Scanner(System.in);
System.out.println("Ingresa tu nombre");
nombre=teclado.nextLine();
System.out.println("Ingresa de que material esta hecho tu pagobus");
material=teclado.nextLine();
System.out.println("Selecciona que tipo de pagobus es el tuyo: \n (1) Personas
mayores de 60 años \n (2) Estudiante \n (3) Personas discapacitadas \n (4)
Preferencial");
tipodePagobus=teclado.nextLine();
System.out.println("De que color es tu pagobus");
color=teclado.nextLine();
System.out.println("Ingresa tu numero de serie");
numeroSerie=teclado.nextInt();
System.out.println("¡Hola De Nuevo! "+ nombre);
System.out.println("¿Que deseas hacer? \n (1) Recargar saldo \n (2)consultar
saldo \n (3) Consultar la fecha de vencimiento de mi Pagobus");
opcion=teclado.nextByte();
switch(opcion){
case 1:
System.out.println("Introduce la cantidad que deseas Recargar");
cantidad=teclado.nextDouble();
System.out.println("¡Haz recargado exitosamente!");
break;
case 2:
System.out.println("Tu saldo Actual es de:$"+ cantidad);
break;
case 3:
System.out.println("para mayores informes por favor marcar a este numero
477 757 7585");
break;
default:
}
System.out.println("¡VUELVE PRONTO!");
}
}

También podría gustarte