Answer:
In Java:
import java.util.*;
public class Main{
public static void main(String[] args) {
int male, female;
Scanner input = new Scanner(System.in);
System.out.print("Male: ");
male = input.nextInt();
System.out.print("Female: ");
female = input.nextInt();
System.out.println("Male%: "+(male*100)/(male+female)+"%");
System.out.println("Female%: "+(female*100)/(male+female)+"%"); }}
Step-by-step explanation:
This declares the number of boys and girls as integers
int male, female;
This prompts the user for number of male
System.out.print("Male: ");
This gets input for number of male
male = input.nextInt();
This prompts the user for number of female
System.out.print("Female: ");
This gets input for number of female
female = input.nextInt();
This calculates and prints the percentage of male students
System.out.println("Male%: "+(male*100)/(male+female)+"%");
This calculates and prints the percentage of female students
System.out.println("Female%: "+(female*100)/(male+female)+"%");