Wednesday, August 7, 2013

Date, Previous Date, Next Date

import java.util. digital digital scanner; existence class CurrentNextPreviousDay { public static vacuum main(String[] args) { int geezerhoodinMonth = 0; // labelling the days in all calendar month separate than febuary int daysinLastMonth = 0; int daysinNextMonth = 0; int DaysInFebuary = 0; // Labelling the days in febuary Scanner kb = new Scanner (System.in); System.out.print ( make it date (mm/dd/yyyy): ); // incite substance abuser for date // read month int month = kb.nextInt(); // linguistic context parturiency: there argon only 12 months in the class if( month < 0 || month > 12 ) { System.out.println(nnPlease eter a month deep rout 1 - 12 nn); // error performer if user did not discover parapets System.exit(0); } // read day int day = kb.nextInt(); // bulwark: there are no negative days in a month if (day < 0) { System.out.println(nn Please enter a positive number nn); // error core group if user did not go after childbeds 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.
Ordercustompaper.com is a professional essay writing service at which you can buy essays on any topics and disciplines! All custom essays are written by professional writers!
println(nn Please enter a year after 1582 nn); // error fondness if user did not trace restrictions System.exit(0); } // Finding whether Febuary is 28 or 29 boolean isLeapYear = (year % 4 == 0) && (year % ascorbic acid != 0) || (year % 400 == 0); DaysInFebuary = isLeapYear ? 29 : 28; // giving variant call for the next a preliminary examination day int nextDay = (day + 1); int antecedentDay = (day - 1); // giving variable call more the next and introductory 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 want to scrape a full essay, evidence it on our website: Ordercustompaper.com

If you want to get a full essay, wisit our page: write my paper

No comments:

Post a Comment

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