Guest User

Untitled

a guest
Aug 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4.  
  5. class Main {
  6.  
  7. public static void main(String[] args) {
  8. public class Contador{
  9. String mensaje;//declarando variable string
  10. String user;
  11. {
  12. mensaje="Hakim>>\n\thola mi nombre es Hakim y el tuyo?\nTu>";
  13. System.out.println(mensaje);
  14.  
  15. Scanner teclado= new Scanner(System.in);
  16. user=teclado.nextLine();
  17.  
  18. mensaje="Hakin>>\n\tMucho gusto"+ user;
  19. System.out.println(mensaje);
  20.  
  21.  
  22.  
  23. //Contador de segundos de vida
  24. mensaje="\tQué edad tienes?\n"+user +">>";
  25. System.out.println(mensaje);
  26.  
  27. int edad;
  28. edad=Integer.parseInt(teclado.nextLine());
  29.  
  30. int Vida;
  31. Vida=edad*365*24*60*60;
  32.  
  33. mensaje="Hakin>>n\tAproximadamente has vivido más de " + Vida + "segundo";
  34. System.out.println(mensaje);
  35.  
  36. mensaje=(edad>17) ? "\tEres adulto, genial jajajaja!": "\teres menor de edad, temdré cuidado";
  37. System.out.println(mensaje);
  38.  
  39. mensaje="\tCúal es tu estatura en metros?\n"+ user+ ">>";
  40. System.out.println(mensaje);
  41.  
  42. double estatura;
  43. estatura=teclado.nextDouble();
  44.  
  45. mensaje="Hakin\n\tTu crecimiento anual ha sido así";
  46. System.out.println(mensaje);
  47.  
  48. mensaje="metros/año\t\t mm/año";
  49. System.out.println(mensaje);
  50.  
  51. double creceM;
  52. double creceCM;
  53. double creceMM;
  54. creceM=estatura/edad;
  55. creceCM= (estatura*100) / edad;
  56. creceMM= (estatura*100) / edad;
  57.  
  58. System.out.printf( " %8.6f\t\t%6.4f\t\t%4.3f\t\t", creceM, creceCM, creceMM);
  59.  
  60. mensaje="\tSeguro que ni te imaginabas";
  61. System.out.println(mensaje);
  62.  
  63. mensaje="\tLo sé todo";
  64. System.out.println(mensaje);
  65.  
  66. mensaje="\tJajhaaja";
  67. System.out.println(mensaje);
Add Comment
Please, Sign In to add comment