Question: I need my code to provide outputs that match the decision tree I made as the user inputs various answers. This was the best I
I need my code to provide outputs that match the decision tree I made as the user inputs various answers. This was the best I could do, but the code is not compiling correctly and does not output the desired results in a clean way. Could you look over this and edit it such that it is more clean and provides the outputs it is supposed to?
#include
#include
#include
using namespace std;
//function with return value
string getChoice1() {
string choice1;
cout
cout
cout
cin >>choice1;
return choice1;
}
string getChoice4() {
string choice4;
cout
cout
cout
cin >> choice4;
return choice4;
}
void getChoice5(string choice4,string&choice5)
{
if (choice4 =="a")
{
cout
cout
cout
cin >> choice5;
}
}
void getChoice2(string&choice2)
{
cout
cout
cout
cin >> choice2;
}
void getChoice3(string&choice3)
{
cout
cout
cout
cout
cin >>choice3;
}
int main()
{
string choice1;
string choice2;
string choice3;
string choice4;
string choice5;
choice1 = getChoice1();
if (choice1 == "a")
{
choice4 = getChoice4();
}
getChoice5(choice4,choice5);
if (choice5 == "a")
{
cout
}
else
{
cout
}
if (choice1 == "a")
{
cout
}
else
{
getChoice2(choice2);
if (choice2 == "a")
cout
}
else{
cout
cout
}
}
}
}
You wake up to visit grandma and your car does not start. Do you a) Get a jump start and head to AutoZone; b) Stay home because you visited last week If (a) Yes No You get in the car and haul to Autozone You go back inside and crash on the couch. Do you a) Call grandma and explain the situation; b) Find a TV show to binge watch If (a) No You turn on the TV. Do you a) fall asleep instead; b) watch your favorite show You get to Autozone to find out that your alternator was a literal potato the entire time. A real one will cost $300 Do you a) buy a new one; b) leave your car there and cry at home Yes If (a) Your Grandma understands and you have a broken car No If (a) No Your grandma is disappointed, you have a broken car, but at least now you know that Mufasa's death is avenged. You simply cry Yes Yes Your alternator is replaced! On your way to Granma, you find a man with a broken down car on the road. Do you a) help him; b) drive on by Your Grandma is disappointed in you, you have a broken car, and have done nothing with your day If (a) NO Yes You are able to go to Granma's with a clear conscience and a fixed car. You go to Grandma's with a fixed car, yet your conscience is plagued with guilt for the rest of your life
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
