Create the a Person class with the following: Class Variables String firstname String lastname int birthmonth int birthday int birthyear String ssn All variables above should be private. Constructor The main constructor should take in all values and assign them to their respective private class variables Methods Create a public getters and setters for firstname and lastname and SSN getFirstname getLastname setFirstname setLastname Create a public getter method called getBirthdate, which will return a String composed of their birthday in month/day/year format. For example, if birthmonth=3, birthday=22, birthyear=2000, it should return the String "3/22/2000" Create a public method called verifySSN that takes in a String parameter and returns a boolean. It will check the parameter against the person's SSN and return true or false based on whether they match
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Create the a Person class with the following:
Class Variables
String firstname
String lastname
int birthmonth
int birthday
int birthyear
String ssn
All variables above should be private.
Constructor
The main constructor should take in all values and assign them to their respective private class variables
Methods
Create a public getters and setters for firstname and lastname and SSN
getFirstname
getLastname
setFirstname
setLastname
Create a public getter method called getBirthdate, which will return a String composed of their birthday in month/day/year format. For example, if birthmonth=3, birthday=22, birthyear=2000, it should return the String "3/22/2000"
Create a public method called verifySSN that takes in a String parameter and returns a boolean. It will check the parameter against the person's SSN and return true or false based on whether they match.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images