136k views
2 votes
You are to create a class called Horse. You should create the definition of the class Horse in a file horse.h and the functions for Horse in horse.cpp. You will also create a main program to be housed in horsemain.cpp.

A Horse will have attributes of
a) Breed (string)
b) Weight (float)
c) Name (string)
d) Gender ('m' or ' f ')
e) Spayed or neutered (yes/no)
f) Registration ID (alphanumeric like HZ123X)
g) Color description (this could be more than a single word)
h) Other comments (also more than a single word)

User Jewilmeer
by
8.9k points

1 Answer

2 votes

Final answer:

A horse can be classified based on its breed, weight, name, gender, spayed/neutered status, registration ID, color description, and other comments. A class called 'Horse' can be defined in C++ with the 'horse.h' and 'horse.cpp' files, along with a main program. The 'Horse' class can have attributes and functions to manipulate horse objects.

Step-by-step explanation:

A horse can be classified in different ways. One way to classify a horse is by its breed, weight, name, gender, spayed/neutered status, registration ID, color description, and other comments. These attributes define the specific characteristics of an individual horse. The class 'Horse' can be defined in a C++ program using the 'horse.h' file to declare the class and the 'horse.cpp' file to implement the functions. The main program, 'horsemain.cpp', can be used to interact with the 'Horse' class and perform operations on horse objects.

User Joel R Michaliszen
by
8.0k points