Answered step by step
Verified Expert Solution
Link Copied!

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions