[solved]-Working Programing Assignment Ve Also Pasted Current Code Assignment Issue Last System Sup Q39027322
Working on the below programing assignment. I’ve also pasted mycurrent code below the assignment. My issue is that the last systemout that is supposed to print the number of kills is notdisplaying. The first three println statements are workingcorrectly but the last one that should print the answer is not.
Assignment
Kangaroos, native animals of Australia, regularly jump onto theroad in the outback just when a car is coming along, especially atnight because the car headlights scare them. Sadly, many kangaroosget killed in these collisions. The Royal Automobile Club ofAustralia needs a computer program to calculate the expected numberof kills each year. This will be done for square parcels of land,each of which has roads of known length running through it.
The program needs to get the following information from theuser:
- The length of the side of the square of land (inkilometers).
- The length of the roads running through the square (inkilometers).
- The number of kangaroos living in that square.
The calculation of the expected number of kills has two phases.First, the kangaroo density has to be calculated (this isthe number of kangaroos per square kilometer). Second, the roadsurface area has to be calculated using the average Australianroad width which is 10 meters. The product of these two numbers isfurther multiplied with the well-known road kill probabilityconstant which is 1.47.
Here is a sample run with the keyboard input in italics:
Enter the side length of the square ofland in km: 3.5
Enter the road length running throughthe square in km: 10
Enter number of kangaroos living inthe square: 150
Expected number of kills:1.8
Current Code
import java.util.Scanner;
public class Geometry2 {
public static void main(String[] args) {
// TODO Auto-generated methodstub
Scanner scan = newScanner(System.in);
double landArea, landLength,roadLength, density, surface, numberOfKills;
int kangaroos;
System.out.println(“Enter the sidelength of the square of the land in Kilometers”);
landLength =scan.nextDouble();
System.out.println(“Enter the roadlength running through the square in Kilometers”);
roadLength =scan.nextDouble();
System.out.println(“Enter thenumber of Kangaroos living in the area”);
landArea = scan.nextDouble();
kangaroos = scan.nextInt();
landArea = (landLength *landLength);
density = kangaroos /landArea;
surface = roadLength * 10;
numberOfKills = ((density * surface* 1.47) / 1000);
System.out.printf(“Expected numberof kills: %.1fn”, numberOfKills);
}
}
Expert Answer
Answer to Working on the below programing assignment. I’ve also pasted my current code below the assignment. My issue is that the … . . .
OR

