.

Saturday, December 21, 2013

Date, Previous Date, Next Date

import java.util. digital scanner; earth class CurrentNextPreviousDay { public static vacuum main(String[] args) { int ageinMonth = 0; // labelling the geezerhood in any calendar month separate than febuary int sidereal daysinLastMonth = 0; int daysinNextMonth = 0; int DaysInFebuary = 0; // Labelling the days in febuary Scanner kb = new Scanner (System.in); System.out.print ( envision date (mm/dd/yyyy): ); // incite user for date // acquire month int month = kb.nextInt(); // setting parturiency: there are hardly 12 months in the stratum if( month < 0 || month > 12 ) { System.out.println( enjoy eter a month deep mow 1 - 12 ); // error heart and soul if user did not follow parapets System.exit(0); } // read day int day = kb.nextInt(); // restriction: there are no negative days in a month if (day < 0) { System. out.println( Please enter a positive number ); // error gist if user did not follow restrictions System.exit(0); } // read year int year = kb.nextInt(); // restriction: cant be less than year 1582 in a Gregorian calendar if ( year < 1582 ) { System.out.
Order your essay at Orderessay and get a 100% original and high-quality custom paper within the required time frame.
println( Please enter a year by and by 1582 ); // error essence if user did not follow restrictions System.exit(0); } // Finding whether Febuary is 28 or 29 Boolean isLeapYear = (year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0); DaysInFebuary = isLeapYear ? 29 : 28; // grownup variant names for the next a preliminary day int nextDay = (day + 1); int antecedentDay = (day - 1); // freehand variable names mo! re the next and antecedent month int nextMonth = (month + 1); int previousMonth = (month - 1); // giving variable months january (firstMonth) and decemeber (lastMonth) int firstMonth = 1; int lastMonth = 12; // giving variable for the number of days in the months january (firstMonth) and decemeber (lastMonth) int daysInDecember = 31; int...If you trust to start a full essay, order it on our website: OrderEssay.net

If you want to get a full information about our service, visit our page: write my essay

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.