Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.x;
- class Auto
- {
- double distancia, tiempo;
- void capturar()
- {
- Scanner leer=new Scanner (System.in);
- System.out.println("Digite la Distancia: ");
- distancia=leer.nextdouble();
- System.out.println("Digite el Tiempo: ");
- tiempo=leer.nextdouble();
- }
- void resultado ()
- {
- double velocidad;
- velocidad=distancia/tiempo;
- System.out.println("la Velocidad es: "+velocidad);
- }
- }
- class DemoAuto
- {
- public static void main (String args [])
- Auto a1=new Auto();
- System.out.println();
- a1.capturar();
- a1.resultado();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement