Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- double maleStudents;
- double femaleStudents;
- double peopleInClass;
- double malePercent;
- double femalePercent;
- maleStudents = keyboard.nextInt();
- femaleStudents = keyboard.nextInt();
- peopleInClass = maleStudents + femaleStudents;
- malePercent = maleStudents / peopleInClass;
- femalePercent = femaleStudents / peopleInClass;
- System.out.println("Students in class: " + peopleInClass);
- System.out.println("Percent of male students: " + malePercent);
- System.out.println("Percent of female students: " + femalePercent);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment