Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
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