A. Design a Dog class that includes fields for a breed (for example, “Labrador”) and eye color.
Include extraction and insertion operators.
B. Overload an operator*()function for the Dog class. When you multiply two Dogs, the
result is a Dog. If the two operand Dogs are the same breed, then the resulting Dog is that
breed; if the two operand Dogs have different breeds, then the resulting Dog is “Mixed”
breed. Obtain a random number of 0 or 1 for the resulting Dog’s eye color. (See Appendix E
for instructions on creating random numbers.) When the random number chosen is 0, use
the eye color from the first operand Dog for the resulting Dog’s eye color; when the random
number is 1, use the eye color of the second Dog for the result Dog.
C. Write a main()function in which you declare four parent Dogs. When you execute the
program, make sure you assign the same breed to two Dogs, and different breeds to each of
the other two Dogs. (You will have a total of three breeds for the four Dogs.) Also assign a
variety of
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-50418.pdf
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment