Question: C++ please The first part will require user input that indicates whether the user will adopt based off of a certain amount of cats or

C++ please

The first part will require user input that indicates whether the user will adopt based off of a certain amount of cats or based off of a budget.

  • If the user enters 1, then they will be prompted to enter the amount of cats they would like to adopt.
  • If the user enters 2, then they will be prompted to enter their budget amount (integer).
  • For both options 1 and 2, a menu will be prompted asking if the user would like a small cat ($25), medium cat ($40), or a large cat ($65) by inputting 1, 2, or 3 respectively.
    • If the user had chosen a certain amount of cats to adopt, then the user will be able to choose either sizes until they reach their chosen amount. The program will then output the total price they paid for the amount of cats they originally specified to adopt.
    • If the user had chosen a budget, then the user will be able to buy until they can no longer buy the cheapest cat or they decide to quit. The program will then output the amount of cats purchased and their remaining budget (even if it is $0).

Additional Notes:*

  • When prompted for an input for an option, we will only enter in numbers within that range. EX) We won't enter in 20 when only options 1 and 2 are present.use both for- and while-loops.
  • While using the budget option, if the amount entered or if the remaining budget is less than $25, then the loops should end. Also, users should be outputted an error when trying to adopt a cat that is higher than their current budget.

Example:

Please select an adoption process: 1) Adoption by animal amount 2) Adoption by budget **1** Enter the amount of animals you are adopting: **2** Which cat would you like to adopt? 1) Small cat ($25) 2) Medium cat ($40) 3) Large cat ($65) **1** You have chosen a small cat for $25! Which dog would you like to adopt? 1) Small cat ($25) 2) Medium cat ($40) 3) Large cat ($65) **3** You have chosen a large cat for $65! Your final total is $90 for 2 cat(s). 
Please select an adoption process: 1) Adoption by animal amount 2) Adoption by budget **2** Enter your adoption budget: $**50** Which cat would you like to adopt? 1) Small cat ($25) 2) Medium cat ($40) 3) Large cat ($65) **3** Sorry but you cannot afford that option. Enter your adoption budget: $**50** Which cat would you like to adopt? 1) Small cat ($25) 2) Medium cat ($40) 3) Large cat ($65) **2** You have chosen a medium cat for $40! You have bought 1 cat(s) with $10 remaining.

Code done so far

#include using namespace std;

int main() {

int choice, animalChoice, total = 0 cout << "Please select an adoption process:" << endl; cout << "Adoption by animal amount" << endl; cout << "Adoption by budget" << endl; cin >> choice; if (choice == 1):{ }

else if (choice == 2):{ } 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!