Answered step by step
Verified Expert Solution
Question
1 Approved Answer
check the below code and run it after completing the requirenment? Base classes: + Person ++ attributes: givenName (String), lastName (String), age (int), gender (String),
check the below code and run it after completing the requirenment? Base classes: + Person ++ attributes: givenName (String), lastName (String), age (int), gender (String), citizenship (String) + Shape ++ attributes: width (double), height (double), radius (double), length (double) + Book ++ attributes: title (String), year (int), publish (String), pages (int) + Animal ++ attributes: name (String), weight (double), favouriteFood (String), age (int)
Required to extend from previous Base Classes the Children Classes.
Inheritance classes: + Person ++ Student +++ attributes: marks (double []), disciplines (String []) +++ methods: averageMarks(), displayDisciplines () ++ Lecturer +++ attributes: salary (double), disciplines (String []) +++ methods: annualSalary(), displayDisciplines () ++ Doctor +++ attributes: speciality (String) ++ Patient +++ attributes: diagnostic (String); inTime (String); prevTime (String); -------------------------------------------------------------------------------- + Shape ++ Rectangle +++ methods: area() ++ Circle +++ methods: area() ++ Triangle +++ methods: area() -------------------------------------------------------------------------------- + Book ++ EBook +++ attributes: url (String) ++ PhysicalBook +++ attributes: shelf (int), aisle (int), floor (int) +++ method: displayBookLocation() -------------------------------------------------------------------------------- + Animal ++ Lion +++ methods: makeSound() ++ Turtle +++ methods: makeSound() ++ Chameleon +++ methods: makeSound() Requirements: + Implement Accessors; + Implement Mutators; + Implement Basic Constructor; + Implement Parametric Constructor; + Implement methods required;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Sure Ill extend the base classes with the specified child classes Person class class Person String g...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