The Student Room Group

AQA Computer Science GCSE Controlled assessment

How do you set a disease trigger point in the coding?
Original post by akirne39
How do you set a disease trigger point in the coding?

I would suggest you add a bit more context to it as anyone not doing this task won't have a clue. I have been doing this task so I understand what you mean, but many won't. To add a disease trigger point, you need to get the user to input a value which they want to use as the trigger point. Then, you need to validate it and save it to a variable as you would have done for the other values earlier. Next, you go to the section where you are calculating the values for the next generation and add an if statement.
If total=< diseaseTrigger then
do as you were doing before
Else calculate a disease factor randomly between 0.2 and 0.5
do the stuff but with the juveniles and seniles affected by the disease factor
End if
HTH :smile: I'm happy to answer any other questions you have as I've almost completed this now :smile: Red is for every other line in the code as the formatting on TSR is really messed up atm :frown:
(edited 7 years ago)
Reply 2
Original post by Lemur14
I would suggest you add a bit more context to it as anyone not doing this task won't have a clue. I have been doing this task so I understand what you mean, but many won't. To add a disease trigger point, you need to get the user to input a value which they want to use as the trigger point. Then, you need to validate it and save it to a variable as you would have done for the other values earlier. Next, you go to the section where you are calculating the values for the next generation and add an if statement. If total=< diseaseTrigger then do as you were doing before Else calculate a disease factor randomly between 0.2 and 0.5 do the stuff but with the juveniles and seniles affected by the disease factor End if HTH :smile: I'm happy to answer any other questions you have as I've almost completed this now :smile: Red is for every other line in the code as the formatting on TSR is really messed up atm :frown:


thank you very much

Quick Reply

Latest