exercisePreLab5 - CS116 EXERCISEPrelab5 NOTE: nextlab(lab5...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS116 EXERCISE – Pre lab 5  NOTE: This exercise will be used as part of your  next lab (lab 5) . In this exercise we are going to build an inheritance relationship with  polymorphism to be used in lab 5 (SAVE YOUR WORK SO THAT YOU USE IT  IN LAB 5). 1. Create a class called Employee. This class is  abstract . It has attributes: String name; int socialSecurity; static int id; int currentID; They all have  private  access modifiers. 2. Create a default constructor that initializes the attributes to : AnyName,  12345, advances  id  every time it is called , and assigns it to currentID. 3. Create a non default  (overloaded) constructor  that has as arguments the  attributes: name , socialSecurity. It also advances the id every time it is  called and assigns it to currentID. 4. Produce the proper accessor, mutator (for all attributes) and toString  methods.
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
5.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern