You are on page 1of 1

Stella Connaughton

10.21.15
Nested If/Else Statements are If/Else statements with an If/Else statement inside.
Since the bikeKid has a 30% chance of turning right, theres a 70% chance of him
not turning right. That means he can either turn left or straight. I used a nested
if/else statement, because for the else portion, I inserted that theres a 50%
probability he will turn left. The 50% is of the remaining 70%, which means that
theres a 35% probability he will turn left. There must also be a 35% chance he will
turn straight, as 30+35+35=100. Nested if/then statements allow for more
possibilities to happen, other than just two.

You might also like