Hello I need help in this intro to Java homework It needs to

Hello,

I need help in this intro to Java homework. It needs to be updated the instructions are given. Pleasse avoide any Advanced concepts such as arrays etc as its very basic hw.. Ill be sure to leave a thumbs up ,just be sure to follow all the instructions please.

Code to be updated:

import java.util.Scanner;
public class HwkSample {
public static void main (String[] args) {
    int males, females;
    int totalButterflies, sexRatio, ratioVariance;
    Scanner stdin = new Scanner(System.in);

    System.out.println(\"\ Butterfly Estimator\ \");
    System.out.print(\"Enter the estimated males population: \");
    males = stdin.nextInt();
    System.out.print(\"Enter the estimated females population: \");
    females = stdin.nextInt();

    totalButterflies = males + females;
    sexRatio         = males / females;
    ratioVariance    = males % females;
    
    System.out.println(\"\ Total Butterflies: \" + totalButterflies );
    System.out.println(\"Sex Ratio        : \" + sexRatio );
    System.out.println(\"Variance         : \" + ratioVariance );
}
}
Here is a sample to show how to run the program:
bash-3.00$ java HwkSample                                                  

Butterfly Estimator

Enter the estimated males population: 33
Enter the estimated females population: 22

Total Butterflies: 55
sex Ratio        : 1
Variance         : 11

Instructions:

Solution

Hi, Please find my code.

Please let me know in case of any issue.

import java.util.Scanner;

public class Hwk3 {

public static void main (String[] args) {

  

int males, females;

int totalButterflies, sexRatio, ratioVariance,genderDifference, matingPairs;

Scanner stdin = new Scanner(System.in);

System.out.println(\"\ Butterfly Estimator\ \");

System.out.print(\"Enter the estimated males population: \");

males = stdin.nextInt();

System.out.print(\"Enter the estimated females population: \");

females = stdin.nextInt();

totalButterflies = males + females;

sexRatio = males / females;

ratioVariance = males % females;

genderDifference = males-females;

matingPairs = males*females;

  

System.out.println(\"\ Total Butterflies: \" + totalButterflies );

System.out.println(\"Sex Ratio : \" + sexRatio );

System.out.println(\"Variance : \" + ratioVariance );

System.out.println(\"Gender Difference: \" + genderDifference );

System.out.println(\"Mating Pairs : \" + matingPairs );

}

}

/*

Sample Output:

Butterfly Estimator

Enter the estimated males population: 33

Enter the estimated females population: 22

Total Butterflies: 55

Sex Ratio : 1

Variance : 11

Gender Difference: 11

Mating Pairs : 726

*/

Hello, I need help in this intro to Java homework. It needs to be updated the instructions are given. Pleasse avoide any Advanced concepts such as arrays etc as
Hello, I need help in this intro to Java homework. It needs to be updated the instructions are given. Pleasse avoide any Advanced concepts such as arrays etc as

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site