Shavit

Minutes to Time Calculator

Oct 6th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. // Shavit Borisov
  2. // CW
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class Time {
  7.  
  8.     public static void main(String[] args)
  9.    
  10.     {
  11.         Scanner in = new Scanner (System.in);
  12.        
  13.         int num, hours, minutes;
  14.        
  15.         System.out.println("Enter a value for the minutes: ");
  16.             num = in.nextInt();
  17.            
  18.         hours = num / 60;
  19.         minutes = num % 60;
  20.        
  21.         System.out.println("The time you entered is " + hours + ":" + minutes);
  22.        
  23.         in.close();
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment