Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help with C++? Theres a few examples there on how its supposed to look. Description For the first part of this assignment, you will output
Help with C++? Theres a few examples there on how its supposed to look. Description For the first part of this assignment, you will output a menu displaying three animal choices: an owl, a cat, or a rat. The user will be prompted to type in an integer selecting their choice. Based on their integer input, you will save their pet choice in a string variable (owl", "cat", "rat", or "default") Do this part using a switch statement. At the end of the program, you w output this pet choice along with the user's Hogwarts house For the second part of this assignment, you will ask the user to input positive integers for four personality aspects: bravery, loyalty, intelligence, and cunning. As you might have guessed, these aspects correspond to Gryffindor, Hufflepuff, Ravenclaw, and Slytherin, respectively. You may assume that the user will always input a positive integer for these aspects. The formulae for calculating the percent matches is Gryffindor Bravery/Total; Hufflepuff = Loyalty/Total; Ravenclaw Intelligence Total Slytherin = Cunning/Total; During display, each percentage should be rounded to two decimal points (see the appendix for how to use setprecision and fixed) Next, you will store the name of the highest matching house in a variable. The user's final house will be the one that has the highest input value. If there is a tie between two or more houses, choose the house that comes first in the list above At the end, your program should print out the user's pet choice and their house
Help with C++? Theres a few examples there on how its supposed to look.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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