Starting from:

$25

CSC35- Lab 4: Risk estimator Solved

Overview
Often doctors use tools that estimate how likely a patient will develop an illness. It compiles a number of contributing factors, uses statistical data for each, and then computes the likelihood it will happen.

Naturally, this is not a guarantee. But it is a very helpful guide.

For this lab, you are going to create a Risk Estimator program that will ask a series of yes/no questions and, then, print a percentage to the screen. 

Each question is worth a predetermined number of points. If the user specifies the correct answer, it is added to their total score.

From this, you can compute a Risk Estimate from the answers.

Points Earned 

Risk Estimate = 

Total Points 

Sample Run
The following is a sample run of the program. This is not a real medical test. The user's input is printed in blue. The data outputted from your calculations is printed in red.                                                                                                                                                                                                            2

Have Fun!

Don't use medical questions above. Create your own risk estimator with your own questions and point values.

The following are some example categories. 

Risk of failing an exam
Risk of barfing at a party
Risk of getting into an auto accident
Risk of getting "pwn'd" in a video game Risk of having explosive diarrhea
..
Requirements
You must think of a solution on your own.  The requirements are as follows:

 

Prompt the user for each question 
Use a different theme (and questions) than the example.
Labs using the medical questions above will not receive credit.

Read a 'y' or 'n' answer for each question.
No credit will be given on the lab if y/n is not used.

Print out the correct percentage.
How do you get a value greater than zero? That's your challenge to solve.

At least 5 questions. 
Reading Text

To read text from the keyboard, please read about the ScanChar subroutine in the CSC35 Library. 

Hints
Like all labs, build it in pieces. First get a single If-Statement to work. Then, you can work on the more detailed ones.
All labels must be unique. Choose your names well.
Remember to use 8-bit registers to compare 'y' and 'n'.
             

More products