Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Westlake Hospital is a research hospital doing cutting - edge research on new drugs. They are currently planning a study for a new study -
Westlake Hospital is a research hospital doing cuttingedge research on new drugs. They are currently planning a study for a new studyenhancing drug called StudyMor. They need your help writing an application that will collect the study data for StudyMor and store it in a set of files. They are expecting files named participant.dat and survey.dat. Eventually, they want to be able to look at statistics about the frequency of certain side effects and the drugs overall effectiveness.
You will write a menubased program with options.
Add new participant
Collect survey for participant
Display participants
Quit
For the first option, you will collect information for a participant. They study people who want to know the persons first name, last name, age, and gender. Participants should be assigned an id value not a random number Then if the id value is even then the participant will receive StudyMor, if the id value is odd they will receive a placebo. Whether or not they receive StudyMor should be recorded in the data file.
For the second option, the user gets to choose a participant from the list of participants and enter survey data for them. Each week they will distribute either StudyMor or the placebo to the participant. They will ask the user will then ask the participant the following questions and record the answers.
Did you have any headaches using StudyMor?
Did you have any constipation using StudyMor?
Did you experience any difficulty sleeping while using StudyMor?
List any other potential side effects, you experienced using StudyMor.
Did you feel like you could study more using StudyMor?
To make things a little easier to manage you should keep the survey data in a separate file from the participant list. Each survey data entry should start with the date the survey information was collected and the participant id so we can properly match the survey data to the participant.
The third option will list out all of the study participant information without their survey answers.
Make sure that when you are opening and writing to your two output files, you aren't losing data. You might want to look at this article about appending to text files in CLinks to an external site.. If you just open the file, the default behavior is to erase the contents.
In addition to the header documentation provided above, make sure to provide documentation in your code in the form of inline comments.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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