Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

Students also viewed these Databases questions