// Programmer: Clayton Price
// file: doc_moleman.cpp
// Purpose: this file contains the main function of the program that will model
// a flow chart for determining the cause of stomach upset...according to
// Hans.
#include <iostream>
using namespace std;
int main()
{
/* --------------------- GREEETINGS AND DECLARATIONS ----------- */
char ans;
string name;
cout<<"You are using Hans Moleman's BellyPainMatic...."<<endl<<endl;
cout<<"You will be prompted to answer questions about your pains"<<endl;
do
{
cout<<"Let's begin...what is your first name: ";
cin>>name;
do
{
cout<<"Ok, "<<name<<", is the problem stress related?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // stress related yes
{
do
{
cout<<"Suffering from diarrhea mad dash(y/n): ";
cin>>ans;
} while (ans != 'y' && ans != 'n');
if(ans == 'y') //mad dash yes
cout<<"Well, "<<name<<" diarrhea and sudden fecal urge are common"
" panic symptoms, and can self fulfill.."<<endl;
else // mad dash no
{
do
{
cout<<"Can't eat? Vomiting? (y/n): ";
cin>>ans;
} while (ans != 'y' && ans != 'n');
if(ans == 'y') // vomiting yes
cout<<"Some people can't eat when very nervous, others pig out. I "
"try eating small amount of neutral food, like rice."<<endl;
else // vomiting no
{
do
{
cout<<"Have an alien in your stomach? (y/n): ";
cin>>ans;
} while (ans != 'y' && ans != 'n');
if(ans == 'y') // alien yes
cout<<"Give it up, you're history!"<<endl;
else // alien no
{
do
{
cout<<"Tried exercising?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if (ans == 'n') // exercise no
cout<<"Exercise is the cure all if you can do it."<<endl;
else // exercise yes
{
do
{
cout<<"caffeine or alchohol?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // alchohol yes
cout<<"Drop coffee or alchohol as a test."<<endl;
else // alchohol no
{
do
{
cout<<"doing diet or meditation?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'n') // diet no
cout<<"Diet really affects digestion, meditation may help"<<endl;
else // diet yes
{
do
{
cout<<"Changed job or lifestyle?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') //job yes
cout<<"Don't assume body is at fault"<<endl;
else //job no
{
cout<<"Sometimes, digestive tract problems are due to "
"physical deformities or disease. There may be "
" medical help available...but probably not for you"
<<endl;
}
}
}
}
}
}
}
}
else // stress related no
{
do
{
cout<<"Constant cramping pain?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // cramping yes
{
do
{
cout<<"Is it worse sitting or lying down?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // sitting yes
cout<<"I've gone days eating while standing and sleeping while "
"sitting - all bad"<<endl;
else // sitting no
{
do
{
cout<<"Worse fasting?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // fasting yes
cout<<"May be ulcer or acid problems."<<endl;
else // fasting no
cout<<"May be torn, pulled abdoominal muscle, gall bladder, "
"appendix, or worse!"<<endl;
}
}
else // cramping no
{
do
{
cout<<"Burping and gas?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // gas yes
cout<<"Stay away from me, you heathen"<<endl;
else // gas no
{
do
{
cout<<"Is there blood in the toilet?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if (ans == 'y') // bleeding yes
cout<<"Minor bleeding may occur with major bowel movements."<<endl;
else // bleeding no
{
do
{
cout<<"Are there liquid noises?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // liquid yes
cout<<"Stop drinking booze!"<<endl;
else // liquid no
{
do
{
cout<<"Do you have poor healing, health?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // health yes
cout<<"May not be absorbing vitamins, condition like Celiac"
<<endl;
else // health no
{
do
{
cout<<"Hard or frequent stools?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // stools yes
{
do
{
cout<<"Good fiber eater?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // fiber yes
cout<<"Still suspect diet, maybe something else..."<<endl;
else // fiber no
cout<<"Start reading labels. If you don't tolerate wheat,"
" eat prunes, etc"<<endl;
}
else // stools no
{
do
{
cout<<"Occasional pain?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // occasional pain yes
cout<<"I hope for the best. Stray pains tough to "
"trouble shoot"<<endl;
else //occasional pain no
{
do
{
cout<<"Vomiting and losing weight?(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
if(ans == 'y') // losing weight yes
cout<<"The flu or food poisoning frequently cause "
"vomiting, but I'd think about seeing a witch "
"doctor if I ate well and kept puking for weeks "
"or losing weight until I disappeared."<<endl;
else // losing weight no
cout<<"Could be a lot of bad things, and you're going"
" to die anyway."<<endl;
}
}
}
}
}
}
}
}
do
{
cout<<"Do you want to evaluate another problem(y/n): ";
cin>>ans;
} while(ans != 'y' && ans != 'n');
} while (ans == 'y');
cout<<"\n\nYou have been using a software package that is essentially worthless"
".....\n\n\tbut what can be done? Bye now..."<<endl;
return 0;
}