fork download
  1.  
  2. /**
  3.  *
  4.  * @author Damien Bell <SkyeShatter@gmail.com>
  5.  */
  6. import java.util.Scanner;
  7. class Jtutorial1 {
  8. public static void main(String args[]){
  9. Scanner input = new Scanner(System.in);
  10.  
  11. int days=0, hours=0, minutes=0, seconds=0;
  12.  
  13. //Prompt the user fpr how many days. How many hours. How many minutes. And how many seconds.
  14. //Take each measure, and convert it to a common measurement.
  15. //Output the common measure.
  16. System.out.println("Please enter a number of days: ");
  17. days = input.nextInt();
  18.  
  19. System.out.println("Please enter a number of hours: ");
  20. hours = input.nextInt();
  21.  
  22. System.out.println("Please enter a number of minutes: ");
  23. minutes = input.nextInt();
  24.  
  25. System.out.println("Please enter a number of seconds: ");
  26. seconds = input.nextInt();
  27.  
  28. System.out.print("The number of seconds in: " + days + " Days " + hours + " Hours " + minutes + " minutes " + seconds + " seconds is: ");
  29.  
  30. hours += (days*24);
  31. minutes += (hours*60);
  32. seconds += (minutes*60);
  33. System.out.print(seconds);
  34. System.out.println();
  35.  
  36.  
  37. } //End main
  38. } //End class
  39.  
Not running #stdin #stdout 0s 0KB
stdin
1
2
12
34
stdout
Standard output is empty