Lab1 COMP 249 solution

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (4 votes)

 

  1. Create a Person class with the following attributes:
    • String : name (1 word)
    • int : age
    • char : gender
  2. Your class should contain the following methods:
    • A private void method format, which will edit the name stored in the attribute name so that the 1st letter is upper case and the remainder of the letters are lower case. This method should be called by all methods in this class that modify or assign a new value to the attribute name.
    • Adefault constructor which sets name to the null string age to zero and gender to null.
    • A copy constructor
    • A constructor with 3 arguments and assign the passed values to the corresponding parameters.
    • Mutator and accessor methods
    • Equals method to return true if the value of the 3 attributes being compared are the same and false otherwise.
    • The toString() method.

 

Submission: Once you are done:

 

  1. Upload your program to EAS under Lab1.

Please name your file following this convention:

  • If the work is done by 1 student: Your file should be called lab1_studentID, where studentIDis your student ID