Guest User

Untitled

a guest
Jul 15th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Altura{
  4. double vo;
  5. double t;
  6. double g=9.807;
  7.  
  8.  
  9. public Altura(){
  10.  
  11. }
  12.  
  13.  
  14.  
  15. public void procesoCalculo(){
  16. double h=0;
  17. double aux;
  18. double aux2;
  19.  
  20. Scanner reader = new Scanner(System.in);
  21.  
  22. System.out.println("Ingrese la velocidad inicial en KM: ");
  23. double vo=reader.nextDouble();
  24. System.out.println("");
  25. System.out.println("Ingrese el tiempo de la caida del objeto en sugundos: ");
  26. double t=reader.nextDouble();
  27. System.out.println("");
  28.  
  29.  
  30. aux= (vo-t);
  31. aux2= (g*t*t)/2;
  32.  
  33. h= (aux+aux2);
  34.  
  35. System.out.println(" La altura es: "+h);
  36.  
  37.  
  38.  
  39. }
  40.  
  41. public static void main(String[] args){
  42.  
  43.  
  44. Altura cal= new Altura();
  45. cal.procesoCalculo();
  46.  
  47. }
  48.  
  49. }
Add Comment
Please, Sign In to add comment