// Import whatever packages you need
// Declare a class
//
public class Whatever
//Create a main() method
//
public static void main(String [] args) {
//
// Put whatever variable declarations/definitions you need.
// For example, define keyboard and assign an appropriate value.
//
System.out.print("Enter the month (1-12) : ");
int month = keyboard.nextInt();
System.out.println("You entered " + month);
System.out.print("Enter the day of the month (1-31) : ");
int day1 = keyboard.nextInt();
System.out.println("You entered " + day1);
System.out.print("Enter the year (e.g, 1776, 2013) : ");
int year1 = keyboard.nextInt();
System.out.println("You entered " + year1);
int adjustedMonth, adjustedYear, century, monthCorrection;
if (month <= 2) {
adjustedMonth = month += 10;
adjustedYear=year1 -=1;
}
else {
adjustedMonth = month-=2;
adjustedYear = year1;
}
System.out.println("\nadjustedMonth = " + adjustedMonth +
", adjustedYear = " + adjustedYear);
//
// If either of the two previous values is not what you expect, look
// carefully at the code. If you can't see what the problem is, go back
// and put print statements inside the if{} block and inside the else{} block.
monthCorrection = (((adjustedMonth * 26) - 2) % 10);
// For debugging: print monthCorrection
century = adjustedYear % 100;
// For debugging: print century
//
// etc.
//
} // End of main()
} // End of class definition