Question: ASAP PLSSS Exercise 3. Polymorphism Define at least one subclass an extension of the superclass Rider (from Ex1.) of your choice (horseRider, bikeRiders, ...). Define

ASAP PLSSS
ASAP PLSSS Exercise 3. Polymorphism Define at least one subclass an extension
of the superclass Rider (from Ex1.) of your choice (horseRider, bikeRiders, ...).

Exercise 3. Polymorphism Define at least one subclass an extension of the superclass Rider (from Ex1.) of your choice (horseRider, bikeRiders, ...). Define a class RiderCompany that contains information about the company: name, number of riders, and an array of references of the Rider class. For the needs of this class, define a constructor that accepts only one argument - the company name, and a no-argument constructor and the following methods should be defined: void addRider() - a method that will add a new Rider to the array of Riders. double averageOfNumberTours() - a method that returns the average of the number of tours of all riders in the company void printRiders() - a method that prints how many riders there are from each type of riders in the company Hint: For the last method you can use static members and static functions in each of the classes (ex. getClass().getNAme(); instanceOf, etc), dynamic_cast

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!