motocicleta.java


public class motocicleta {

string=marca;
string=modelo;

int estado_motor();
void encender_motor()
{
if (estado_motor ==1)
System.out.println("EL MOTOR ESTA ENCENDIDO”);
Else
{
estado_motor=1;
System.out.println("EL MOTOR ESTA APAGADO”);
}
}
void mostrar_atributos()
{
System.out.println("EL MOTOCICLISTA ES:” + color + “MARCA”);
if (estado_motor ==1)
System.out.println("EL MOTOR ESTA ENCENDIDO”);
Else
System.out.println("EL MOTOR ESTA APAGADO”);
}
public static void main(String[] args)
{
motocicletas m=new motocicletas;
m.marca=”HONDA CBR750”;
m.color=”AMARILLA”;
System.out.println("CARACTERISTICAS DE LA MOTOCICLETA");
m.mostrar_atributos ();
System.out.println("_________________________”);
System.out.println("ESTADO DEL MOTOR");
m.encender_motor ();
}
}

0 Tu opinion =D: