Question #45396

A group of students have been told to get into teams of a specific size for their class work. design and implement a program that prompts for the number of students in the group and the size of the teams to be formed, and display how many teams can be formed and how many students are left without a team.

Expert's answer

import java.util.Scanner;public class GroupsCounter {    public static void main(String[] agrc) {        Scanner sc = new Scanner(System.in);        System.out.println("Please enter the number of students");        int numberOfStudents = sc.nextInt();        System.out.println("Please enter the group capacity");        int groupCapacity = sc.nextInt();        System.out.println("Number of possible groups " + numberOfStudents / groupCapacity);    }}
LATEST TUTORIALS
APPROVED BY CLIENTS