Menu

(Solved) : Code C Text Need Help Input 2 100 3 4 Need Output Look Like Picture Include Using Namespa Q44003762 . . .

1 2 #include <iostream> using namespace std; void displayMenu(); int main() { int choice, animalchoice, total = 0,n, budget,case 2:{ cout<<You have chosen a medium dog for $40!<<endl; total+=40; break; case 3:{ cout<<You have chosen a large dog fdisplayMenu(); cin>>choice; switch(choice) case 1:{ if(budget>=25) cout<<You have chosen a small dog for $25!<<endl; budgetcnt++; D else cout<<Sorry but you cannot afford that option.<<endl; break; case 3:{ if(budget>65) cout<<You have choosen a| cout<<You have bought <<cnt<< dog(s) with $<<budget<< remaining. <<endl; return 0; 98 99 100 101 102 103 104 105 106Here is my code in C++ (thetext), I need help when I input 2 100 3 4 i need the output to looklike the picture below.Please select an adoption process: 1) Adoption by animal amount 2) Adoption by budget Enter your adoption budget: $ Which dog

#include
using namespace std;

void displayMenu();
void displayMenu2();
int main() {
int choice, total = 0,n,budget,cnt=0;
cout << “Please select an adoption process:” <<endl;
cout << “1) Adoption by animal amount” << endl;
cout << “2) Adoption by budget”;
cin >> choice;
if (choice == 1){
cout<<“nEnter the amount of animals you are adopting:”;
cin>>n;
for(int i=0;i {
displayMenu();
cin>>choice;
switch(choice)
{
case 1:{
cout<<“nYou have chosen a small dog for $25!”;
total+=25;
break;
}
case 2:{
cout<<“nYou have chosen a medium dog for $40!”;
total+=40;
  
break;
}
case 3:{
cout<<“nYou have chosen a large dog for $65!”;
total+=65;
  
break;
}
  
}
}
  
cout<<“nYour final total is $”< }
else if (choice == 2){
cout<<“nEnter your adoption budget: $”;
cin>>budget;
  
while(budget>=25)
{
displayMenu2();
cin>>choice;
  
switch(choice)
{
case 1:{
if(budget>=25)
{
cout<<“nYou have chosen a small dog for $25!”;
budget-=25;
cnt++;
}
else
{
cout<<“nSorry, but you cannot afford that option.”;
}
break;
}
case 2:{
if(budget>=40)
{
cout<<“nYou have chosen a medium dog for $40!”;
budget-=40;
cnt++;
}
else
{
cout<<“nSorry, but you cannot afford that option.”;
}
break;
}
case 3:{
if(budget>65)
{
cout<<“nYou have choosen a large dog for $65!”;
budget-=65;
cnt++;
}
else
{
cout<<“nSorry, but you cannot afford that option.”;
}
break;
}
}
  
  
}
  
cout<<“nYou have bought “< }
return 0;
}
void displayMenu()
{
cout<<“nWhich dog would you like to adopt?”<cout<<“1) Small dog ($25)”< cout<<“2) Medium dog($40)”< cout<<“3) Large dog ($65)”;
}
void displayMenu2()
{
cout<<“nWhich dog would you like to adopt?”<cout<<“1) Small dog ($25)”< cout<<“2) Medium dog($40)”< cout<<“3) Large dog ($65)” < cout<<“4)Exit”;
}

1 2 #include <iostream> using namespace std; void displayMenu(); int main() { int choice, animalchoice, total = 0,n, budget, cnt=0; cout << “Please select an adoption process:” << endl; cout << “1) Adoption by_animal amount” << endl; cout << “2) Adoption by budget” << endl; cin >> choice; if (choice == 1){ cout<<“Enter the amount of animals you are adopting:”; cin>>n; for(int i=0;i<n;i++) 14. displayMenu(); cin>>choice; switch(choice) case 1:{ cout<<“You have chosen a small dog for $25!”<<endl; total+=25; break; case 2:{ cout<<“You have chosen a medium dog for $40!”<<endl; total+=40; break; case 3:{ cout<<“You have chosen a large dog for $65!”<<endl; total+=65; break; cout<<“Your final total is $”<<total<<” for “<<n<<” dog(s).”<<endl; else if (choice == 2) { cout<<“Enter your adoption budget: $”; cin>>budget; 48 while(budget>=25) displayMenu(); cin>>choice; switch(choice) case 1:{ if(budget>=25) cout<<“You have chosen a small dog for $25!”<<endl; budget-=25; cnt++; else cout<<“Sorry but you cannot afford that option.”<<endl; break; case 2: { if(budget>=40) cout<<“You have choosen a medium dog for $40!”<<endl; budget-=40; cnt++; D else cout<<“Sorry but you cannot afford that option.”<<endl; break; case 3:{ if(budget>65) cout<<“You have choosen a large dog for $65!”<<endl; budget-=65; cnt++; else cout<<“Sorry but you cannot afford that option.”<<endl; break; 94 } | cout<<“You have bought “<<cnt<<” dog(s) with $”<<budget<<” remaining. “<<endl; return 0; 98 99 100 101 102 103 104 105 106 107 108 109 110 111 void displayMenu() { cout<<“nwhich dog would you like to adopt?”<<endl; cout<<“1) Small dog ($25) “<<endl; cout<<“2) Medium dog ($40) “<<endl; cout<<“3) Large dog ($65)”<<endl; } Please select an adoption process: 1) Adoption by animal amount 2) Adoption by budget Enter your adoption budget: $ Which dog would you like to adopt? 1) Small dog ($25) 2) Medium dog ($40) 3) Large dog ($65) 4) Exit You have chosen a large dog for $65! Which dog would you like to adopt? 1) Small dog ($25) 2) Medium dog ($40) 3) Large dog ($65) 4) Exit You have bought 1 dog(s) with $35 remaining. Show transcribed image text 1 2 #include using namespace std; void displayMenu(); int main() { int choice, animalchoice, total = 0,n, budget, cnt=0; cout

Expert Answer


Answer to Here is my code in C++ (the text), I need help when I input 2 100 3 4 i need the output to look like the picture below. …

OR