CS120 Project 3 kickoff lab assignment

Let’s kick off your work on Project 3 by introducing a method to your code for Project 1.

Right now, your Project 1 code does everything in its main method — input, calculation of the new date, and output.

To start introducing methods to your code, add a method which takes care of the date calculation and printing. Your main method should read in input, and then call the new method. Your new method should be called:

public static void calcAndPrint(int monthNumber, int dateNumber, int numberOfDays) {
  // ...
}

Aside from any fixes to your original program that you might make, the result of this lab exercise should work just as for Project 1.

Do not give a Java package declaration in your class.

Technical details. Submit the single, plain-text file DateCalc.java to D2L by 8:30am on Wednesday, October 18. Remember to comply with the style guidelines for CS120 Java work.

Testing these assignments. I will write a program to test your work on several different dates and intervals. Be sure to read in input in exactly the order described here; it is in this order that my tester will provide input to your program. Do not expect other interaction with the user except for what thie specification describes.

Submission instructions. Submit the single file DateCalc.java to [[][D2L]] by 8:30am on Monday, September 25. Remember to adhere to the [[][style guidelines]] for CS120 Java work.

Avoid plagiarism. The course syllabus has further details about our expectations of academic integrity. In particular: You may not copy code from any other source and claim it as your own. You may not share any of your code with any other student for use in completing any of these assignments.

Links to: CS120 homepage