Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
image text in transcribed
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

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 1 Lnai 9851

Authors: Paolo Frasconi ,Niels Landwehr ,Giuseppe Manco ,Jilles Vreeken

1st Edition

3319461273, 978-3319461274

More Books

Students also viewed these Databases questions

Question

Guidelines for Informative Speeches?

Answered: 1 week ago