skity

Untitled

Nov 23rd, 2020
683
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Calendar {
  4.  
  5.    
  6.     public static void main(String args[]) {
  7.         int days = 0;
  8.         int yovel, shmita, year, month, day;
  9.         yovel = shmita = year = month = 0;
  10.         Scanner scanner = new Scanner(System.in);
  11.         System.out.println("Please enter a number of days: ");
  12.            
  13.             days = scanner.nextInt();
  14.             yovel = days / (365 * 50);
  15.             days = days - (yovel * 365 * 50);
  16.             shmita = days / (365 * 7);
  17.             days = days - (shmita * 365 * 7);
  18.             year = days / 365;
  19.             days = days - 365 * year;
  20.             month = days / 30;
  21.             days = days - 30 * month;
  22.    
  23.     System.out.println(yovel + " times Yovel.");
  24.     System.out.println(shmita + " times Shmita.");
  25.     System.out.println(year + " times Years.");
  26.     System.out.println(month + " times Months.");
  27.     System.out.println(days + " days.");
  28.     }
  29. }
  30.  
RAW Paste Data