Question: Add a public method called input with no parameters and of type void. In this function, ask the user for the values of the date,

Add a public method called input with no parameters and of type void. In this function, ask the user for the values of the date, then input them in the three attributes. Use scan.nextInt() to input the three values. If the value of the month is larger than 12, make it to 12. If it's less than 1, make it 1. The same way, restrict the dayto the range [1,31].
Add a public method called output with no parameters and of type void. In this function, output the date in the format "mm/dd/yyyy". You don't have to verify if the numbers have the right number of digits.

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 Programming Questions!