Question: Programming Assignment #1 This program is to review the basics of Object-Oriented programming and review some basic Java content. This assignment will be completed in

Programming Assignment #1

This program is to review the basics of Object-Oriented programming and review some basic Java content. This assignment will be completed in Eclipse on your machine.

Write a class named MonthDays. The class should have fields to hold the number of the month (i.e. January is month 1) and the year. Create a minimum to two constructors. Be sure to include accessors and mutators (getters and setters) for each field. Create a method named getNumberofDays that returns the number of days in the specified month. You do not have to take leap year into account.

Create an application to test the class. Create a minimum of two MonthDays objects. Allow the user to enter the month and the year. Be sure to validate the user data for months being 1 - 12 only. The program should then display the number of days for each month.

Be sure to test your program with various input values. Make sure your program is properly documented using comments where needed. Note that this project must be done individually. The program will be checked using a code plagiarism tool against other solutions, so please ensure that all work submitted is your own.

You may read and write from the console window. Make sure your input and output are formatted nicely and easy to read.

You are to submit your MonthDays.java and the test application .java file in Moodle by the due date.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!