Kangaroos, native animals of Australia, are not known for their intelligence. In fact they're pretty stupid. Only slightly smarter than sheep, and that's not saying much. In the outback kangaroos regularly jump onto the road when a car comes along (especially at night, because the car headlights scare them). This makes a serious mess of your car, unless you have a "roo-bar" on the front. Sadly, many 'roos get killed in these collisions. The Royal Automobile Club of Australia needs a computer program to calculate the expected number of kills each year. This will be done for square parcels of land, each of which has roads of known length running through.
The program needs to get the following information from the user:
The calulation of the expected number of kills has two phases. First, the kangaroo density has to be calculated - this is the number of kangaroos per square kilometer. Second, the road surface area has to be calculated, using the average Australian road width which is 10 meters. These are multiplied with the well known roadkill probablility constant, which is 1.47. If the result is not an integer, e.g. 1.8, the fractional part means that the kangaroo was injured, which must also be reported.
Here's what a sample run should look like, with the keyboard input in italics ...
Enter side of square in km : 12.5 Enter roads length in km : 99.9 Enter number of 'roos : 444 Expected number of kills is : 4 Expected number of injuries : 1