Answer:
The Date class below is created using Java.
- public class Date {
- private int day;
- private int month;
- private int year;
- public Date(int d, int m, int y)
- {
- setDay(d);
- setMonth(m);
- this.year = y;
- }
- public void setMonth(int m)
- {
- if(m >= 1 && m <= 12)
- {
- this.month = m;
- }
- else
- {
- throw new IllegalArgumentException("Input Month must be between 1 - 12");
- }
- }
- public void setDay(int d)
- {
- if(d >=1 && d <=31)
- {
- this.day = d;
- }
- else
- {
- throw new IllegalArgumentException("Input Day must be between 1 - 31");
- }
- }
- public void printDate()
- {
- System.out.println(this.month + "/" + this.day + "/" + this.year);
- }
- }
Explanation:
Line 1:
- Create a class and name it as <em>Date</em>
Line 3-5:
- Define three properties/attributes in the Date class which are day, month and year.
- The data type of the properties are defined as integer
Line 7-13:
- Create a class constructor to initialize the values for the properties (day, month and year).
- To initialize the day and month, setDay() and setMonth() setter methods are called. This is to ensure the day and month are within the range of 1-31 and 1-12, respectively.
Line 15-25:
- Create setMonth() setter method with one parameter m to accept one input value.
- The setMonth() method will check the input value m to see if it is bigger or equal to 1 and less than or equal to 31 (the valid range). If not, an error will be thrown.
Line 27 - 37:
- Create setDay() setter method with one parameter d to accept one input value.
- The setDay() method will check the input value m to see if it is bigger or equal to 1 and less than or equal to 12 (the valid range). If not, an error will be thrown.
Line 39 - 42:
- Create printDate() method to display the date as month/day/year (ie 10/1/1999)
- Use Java println() method to print the class property values, month, day, and year.
- Please note that to access the property values, this keyword must be preceded with the property name.
Important notes:
- This program doesn't consider the valid input range of days for Feb (1 - 28 or 29) and for those of the months with only 30 days because this is not expected by the question.
- Beside, the input year is also presumed to be a four digit number.
True, the Windows desktop displays task manager, all programs, computer status, documents...
The answer is the Search Tools tab. It is a tab that appears in the File Explorer window after you click the Search text box; it lets you identify a specific search location, limit your search, repeat previous searches, save searches, and open a folder containing a found file.
Answer:
Talk Softly/ Repeat/ Slow your voice/ Stand at one point/ Sit Down/ Call it out etc
Explanation:
Some of the best answers are mentioned in the Answer section, and you can choose any of these. All will work, and different people use different techniques but they use mainly out of above, as these are the best tricks certainly. My favorite is to repeat before emphasizing as that let us all know that point, and as a speaker, I want that point to be understood by all, as it is important.
Answer:
the testing team
Explanation:
because even though she may have fulfilled the requirements but she still need to test if it runs perfectly or not