60 428
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #50418 in C++ for zexy

Question #50418
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
Expert's answer

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions