java-dbr
  Estado del carro
 

import java.util.*;
public class metodos_carros{
public static void main (String[] args){
int año,vel;
String resultado;
Scanner teclado = new Scanner (System.in);
System.out.print("Año del Carro: ");
año = teclado.nextInt();
System.out.print("Velocidad Maxima (km/h): ");
vel = teclado.nextInt();
resultado= prom(año,vel);
System.out.println(resultado); }
public static String prom (int a,int b){

if (a<=2000){ if(b<=120){
 return "Carro = Viejo y Lento";
} else { return "Carro = Viejo y Veloz"; }

 } else { if(b<=55){
     return "Carro = Nuevo y Lento";
    }else { return "Carro = Nuevo y Veloz"; }
        }
    }
}
 

 
  Hoy habia 26 visitantes (35 clics a subpáginas) ¡Aqui en esta página!  
 
Este sitio web fue creado de forma gratuita con PaginaWebGratis.es. ¿Quieres también tu sitio web propio?
Registrarse gratis