Question: Why is this code not working ? ? #include #include Dog.h #include Cat.h #include Bird.h void displayMenu ( ) { std::cout <

Why is this code not working ??#include
#include "Dog.h"
#include "Cat.h"
#include "Bird.h"
void displayMenu(){
std::cout <<"*****Pet Program*****
"
<< "Please enter 1 for a Dog:
"
<< "Please enter 2 for a Cat:
"
<< "Please enter 3 for a Bird:
"
<< "Please enter 4 to exit:
";
}
int main(){
int choice;
std::string fName, lName, pName;
int year;
std::string breed, color;
do {
displayMenu();
std::cin >> choice;
switch (choice){
case 1:
// Collect details for Dog and create Dog object, then print
break;
case 2:
// Collect details for Cat and create Cat object, then print
break;
case 3:
// Collect details for Bird and create Bird object, then print
break;
case 4:
std::cout << "Exiting program.
";
break;
default:
std::cout << "Invalid option. Please try again.
";
}
} while (choice !=4);
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!