There are two deliverables for this assignment: Your pseudocode and/or flow char
ID: 3760402 • Letter: T
Question
There are two deliverables for this assignment: Your pseudocode and/or flow chart and/or UML diagram planning out what your program will look like when it is finished. Your java files that implement the solution to this problem. Create a class named Horse that contains data fields for the name, color and birth year of a horse. Include get and set methods for these fields. Next, create a subclass named Racehorse (in honor of the Kentucky Derby!), which contains an additional field that holds the number of races in which the horse has competed and an additional field that holds whether or not the horse has run in the Kentucky Derby and additional methods to get and set the new fields. Write an application that demonstrates using objects of each class. Save the classes/files as Horse.java, RaceHorse.java and TestHorse.java.
Explanation / Answer
class horse
{ string name;
string m_color;
int birthyear;
public:
void setcolor(String color);
string getname()
{ return name;
}
int get_birthyear()
{ return birthyear';
}
}
void Horse:setcolor(string color)
{ m_color=color;
}
class racehorse: public Horse
{ int number_of_the_race;
string m_race_name;
string b= kentucky_derby
public:
void get_number()
{ return number_of_race;
}
sting setname(string b)
{m_racename=b;
}
int main()
racehorse p1;
p1.getname();
p1.setcolor();
p1.getbirthyear();
p1.getnumber();
p1.setname();
p1.confirm()
{ if m_racename=b
System.out.println(" participated in kentucky derby");
else
System.out.println("not participated");
}
{ h