Due: Friday, Sept. 15, 2017 at noon 100 points
For this assignment, you will submit a single C++ compilable file containing a program written in C++. Remember, to submit a file for this course electronically, from the directory in which the file resides type in at the UNIX prompt the command: cssubmit 1570 section_letter assignment_number. Be sure that only the file you want to submit is in that directory - make a directory for every assignment! The submit system will deliver every .cpp file in the current directory to me. Name your file a meaningful name and give it a .cpp extension since you will be compiling it. Also, make sure that you compile and run your program using the GNU (g++) compiler before submitting to make sure that it will work for the submit script.
Background: Our hero, Hans Moleman, is interested in becoming a doctor. More precisely, he wants to be a gastroenterologist. To clarify, that's a person who specializes in gastroenterology. He seems to have had a history of stomach problems. Towards this end, he has been doing some of his own home-grown research, writing up results of exquisite and intricate experiments on how belly-aches occur and are mitigated or treated. For the benefit of the general public, he has published a flow chart on how one might treat or react to stomach upset. His flow chart is shown here. You'll notice that, as you follow the flow in this chart (this flow chart), you eventually end up with either a recommendation or some kind of medical commentary that might help you out in the near future. Some of it is just simplistic babble, but the user might still find some value in it.
Specifications: You are to write a program that implements this flowchart. Briefly, your program will prompt for and input information about the user (the sick person) and use the responses to lead to one of the "diagnostic messages" Hans has crafted. Of course, you are to do this right. Here are some requirements:
You are to use the if and if-else statements for decision branching. You are NOT allowed to use the switch-case statement.
You are NOT to us the goto, the break, or the continue statements. You are to use logic and logically structured code to implement.
Your code should greet the user and prompt for and read in their first name (first name only....and assume the name is a contiguous string of non-whitespace characters). Your code should then use that name in at least one prompt for info after that, and in the final output/diagnosis/recommendation.
Your program should do what we call "input cleansing" or range checking. That is, when you prompt for information that can be validated for value, your code should do that. For example, in many of the prompts you will have, you will ask for a response of yes or no (y/n). If you input the response as a char, you can then check to see if they indeed entered 'y' or 'n' and reprompt them if not.
At the end of the execution of a "run" of this stress inquiry, your program should ask the user if they wish to start again - ostensibly for someone else. In any case, the whole line of questioning and diagnosis should repeat until no one else has stomach problems.
When you submit: enter the following responses to questions in the indicated by the diagram:
yes, no, no, no, yes, no, yes, yes
enter a response to indicate do another
answer no to all questions
again, do another
no, yes, yes
quit
As always, don't hesitate to ask your instructor for clarifications or help if you need it.