Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started