Monty374

Time Conversion

Sep 20th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. package ex9;
  2.  
  3. import java.util.Scanner;
  4.  
  5. /**
  6. *
  7. * @author Monty
  8. */
  9. public class Ex9 {
  10.  
  11. /**
  12. * @param args the command line arguments
  13. */
  14. public static void main(String[] args) {
  15. int inputmin;
  16. int hour;
  17. int minutes;
  18. Scanner input = new Scanner(System.in);
  19. System.out.print("Enter the time in minutes: ");
  20. inputmin = input.nextInt();
  21. hour = inputmin / 60;
  22. minutes = inputmin % 60;
  23. System.out.print("The time is: " + hour + ":" + minutes);
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment