Shavit

P. 96 Ex. 1

Oct 11th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. // Shavit Borisov
  2. // HW
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class DaysToWeeks {
  7.  
  8.     public static void main(String[] args)
  9.    
  10.     {
  11.         Scanner in = new Scanner (System.in);
  12.        
  13.         System.out.println("Enter the number of days:");
  14.             int days = in.nextInt();
  15.        
  16.         int weeks = days/7;
  17.        
  18.         System.out.printf("The number of weeks is %d.", weeks);
  19.        
  20.         in.close();
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment