Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Both picture are of same projects. 2nd pic is the continuation of first picture 4 Modify the empty Person class in accordance to the class

Both picture are of same projects. 2nd pic is the continuation of first picture
image text in transcribed
image text in transcribed
4 Modify the empty Person class in accordance to the class description below. 5 create an ageValidation Method that throws an ExceptionInInitializerError exception when the YOB is less than 1900. Use this method in both the constructor and the setYOB methods. You are done with this lab if you pass all the tests in PersonTest We will be learning about unit tests later in the class PERSON CLASS Person Fields String firstName; String lastName; int YOB; - Year of Birth - Range should be 1900-2010 - make sure validations happen in the constructor as well as the setter method. Methods Constructor - 2 constructors; one that takes first and last name, and the other takes the same plus the YOB Getters and Setters returns a int YOB; - Year of Birth - Range should be 1900-2010 - make sure validations happen in the constructor as well as the setter method. Methods Constructor - 2 constructors; one that takes first and last name, and the other takes the same plus the YOB Getters and Setters public String fullName) returns a concatenation of the first and last names public static int calculateAge (int year) - A static method that takes a year and returns an age. - Use the Calendar Object to get current Year (may requires a bit of web search) public int getAge() - gets the age of the person object. - Use the calculateAge method for 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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

What are the different techniques used in decision making?

Answered: 1 week ago

Question

6. Have you used solid reasoning in your argument?

Answered: 1 week ago