Question
Checking up with some real basic java mutator questions: Given.... public class SimpleDate { private String month; private int dat; private int year; public static
Checking up with some real basic java mutator questions:
Given....
public class SimpleDate {
private String month;
private int dat;
private int year;
public static final int FIRST_YEAR = 1970;
....
Part A) Write a mutator method for the year that prevents the year from being set before the first year that computers started counting time
Part B) Write a mutator method for the month. You can assume that the value is provided by the method is valid
Part C) write a mutator method for day, if the value given to this methis is less than 1, it print "Days are greater than zero" Otherwise it should set the numbers of days to provided value OR the maximum days in the month. (30 days for april/june/september/novem... 28 for febuary... and rest with 31)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started