
hi please help me with my project:
Exercise # 1
Create a java program for a class named MyDate that contains data members and a constructor that meet the criteria in the following list. This class is used to initialize instance variables. � The non-static integer data members named month, day, and year should be private members so that they cannot be directly manipulated outside of the class. � The non-static Boolean data member named good should be a public member so that it can be accessed outside of the class. � The constructor MyDate() should assign to the member variables the values 1 to month, 1 to day, and 2006 to year and the value true to good.
MyDate - month: int - day: int - year: int + good: boolean + MyDate()
Exercise # 2 Create a java program for the class MyDate, and call the new class MyDate2. Add a constructor with parameters for month, day, and year that will be used to assign values to the instance variables. Add a method printDate() to display the date. You also need a method to validate the date. In programming, validation means that the values are checked to assure that they are valid for their intended use. For example, a month value must be in the range of 1 to 12, inclusive. It does not mean that the data is correct, only valid.
The UML diagram should meet the following criteria: ïâ??§ The constructor MyDate2() has three integer variables and assigns these values to the integer data members month, day, and year, and assigns the value false to good. The constructor calls the method validate() to make sure that the instance variables contain valid values. ïâ??§ The method named printDate() is void, has no formal parameters, and is a public member so that it can be accessed outside of the class. The member method printDate()displays the date in the format mm dd yyyy. ïâ??§ The method named validate() is void, has no formal parameters, and is a private member so that it can be accessed only within the class. The method validate()checks to make sure that the values for month are in the range of 1 to 12, inclusive, the values for day are within the range for the appropriate month, and the value for year is greater than 0. The method validate()displays either the message "You entered a valid date" or "You entered an invalid date". Finally, it calls the method printDate().
MyDate2 - month: int - day: int - year: int + good: boolean + MyDate() + MyDate(int, int, int) - validate: void + printDate: void
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.