Don't Have A Cow, Dude |
Old MacDonald has a farm and on this farm he has a cow - and a fenced circular pasture with a radius of 100 yards. He plans to tie the cow to a post on the circumfrence of the pasture. He wants the cow to be able to eat one third of the grass in the pasture. How long should the rope be?
You must solve a generalization of this problem.
Write a program which will input two numbers, R (raduis - an integer
between 1 and 100 inclusive) and P (part of - a
real number between 0.0 and 0.5 inclusive) and solve old MacDonald's
problem. How long a rope should old
MacDonald use to allow the cow to eat P of the grass in the circular
pasture of radius R. Express your answer correct
to two decimal places. Use .
Output a statement in the format shown in the sample output below.
1 00 0.33
R = 100, P = 0.33, Rope = 13.24
The value 13.24 in the sample output is purposely not correct. It is included only to show you the correct format