Using your preferred IDE or this online IDE, create a program that asks the user for the number of male and female students registered in a class/section. The program should display the total number of students and the percentage of males and females in the class.
Sample output:
Enter the number of males: 36
Enter the number of females: 17
Number of students = 53
Male = 67.92%
Female = 32.08%
Answers & Comments
Answer:
I already answered this question here using Java:
brainly.ph/question/22193550
Pero ito yung code kung ayaw mo namang pumunta sa link:
import java.util.Scanner;
public class BrainlyUserUnlikely
{
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
double Male;
double Female;
double total;
double MP, FP;
System.out.print("Enter the number of male students: ");
Male = input.nextInt();
System.out.print("Enter the number of female students: ");
Female = input.nextInt();
total = Male + Female;
MP = ((Male / total) * 100);
FP = ((Female / total) * 100);
System.out.println("Total Number of Male Students: " + Male);
System.out.println("Total Number of Female Students: " + Female);
System.out.println("Total Number of Students: " + total);
System.out.println("Percentage of Male Students: " + MP);
System.out.println("Percentage of Female Students: " + FP);
}
}