Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can you please solve this whole code date should be in the form: mm/dd/yyyy with mm, dd, and yyy being a digit. DO NOT worry

can you please solve this whole codeimage text in transcribed

date should be in the form: mm/dd/yyyy with mm, dd, and yyy being a digit. DO NOT worry about the numbers being realistic (1 through 12 for month, 1 through 31 for days, etc.). Just check to make sure there are digits, two slashes and 10 characters in total. - In class, I mentioned we can check user inputs before setting attribute values. Let's do this for the date attribute: Edit your setDate method by calling the checkDate method first before setting the instance variable, date. If the date is not valid, you should print out, "Date not valid" and then use System.exit(0); to make the program exit. Else, if the date is valid, set the date as you already did. - We can take this a step further and call our setDate method in the constructor body to assign the instance variable for date for us. This will make also make it so our date is being checked. How do you think we could do this

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

Students also viewed these Databases questions