Create a class named Horse that includes data fields that hold the name, color, and birth year. Include only a non-default constructor that initializes all of the data fields, and a function that displays detailed information about the Horse. Create another class, RaceHorse which inherits from Horse. RaceHorse has an additional data field that holds the number of races won. Include a constructor that will initialize races won, and a method that displays detailed information about the RaceHorse. Write a main() function demonstrating that classes and functions work correctly. Save the file as Horse.cpp
Comments
Leave a comment