Advertisement
JackHoughton00

TimeConversion

Feb 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. package timeconversion;
  2. import java.util.Scanner;
  3.  
  4. public class TimeConversion {
  5.  
  6. public static void main(String[] args) {
  7. Scanner input = new Scanner(System.in);
  8. int minutes,hours1,hours2 = 0;
  9. System.out.print("Please enter a time in minutes:");
  10. minutes = input.nextInt();
  11. hours1 = minutes/60;
  12. hours2 = minutes%60;
  13. System.out.print("Your time in hours was "+hours1);
  14. System.out.print(":"+hours2);
  15. }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement