Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Introduction to Objects Lab: Objects Lab Challenge ( 4 ) Create the variable dog 1 , and instantiate it as an object of the Dog
Introduction to Objects Lab: Objects
Lab Challenge
Create the variable dog and instantiate it as an object of the Dog class. This dog's name is Marceline and she is a German Shepherd. Create the variable dog and make it a copy of dog dog should be named Cajun and have the breed Belgian Malinois.
Your goal for this assignment is to design the class Dog so that the above can be implemented successfully.
Expected Output
Test your code by printing the name and breed of each dog to make sure they fulfill the requirements above. Most importantly, the third print statement will print false.
Marceline German Shepherd
Cajun Belgian Malinois
false
DO NOT CHANGE the existing code in main
Dog dogMarceline "German Shepherd";
Dog dogdog;
dog name "Cajun";
dogbreed "Belgian Malinois";
cout
dogname dog breed end l
cout dog name dog breed endl
if dog name dog name && dog breed dog breed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started