Optional Project 8: Dartboard

Optional Project 8: The variables 'r1' and 'r2' have been initialized.   These values represent the radii of the two circles shown above (r1 is the smaller radius and r2 is the larger radius).


If we were to throw a dart randomly at the board (not aiming at a certain point), what is the probability the dart would land in the RED region and not the BLUE region? (We are assuming the dart will hit somewhere within the outer circle)


Task: Initialize the value of 'prob' that represents the probability the dart hits the red region.

**If your code works for 5 test cases, you can enter your e-mail address

Universal Computational Math Methods:

pow(5,2) returns 25.0

abs(-3.0) returns 3

sqrt(49.0) returns 7.0