I’m studying for my Java class and don’t understand how to answer this. Can you help me study?
El Centro’s Floor 5 has X number of classrooms that each have a maximum number of 20 students per classroom.
Write a Java program to do the following:
- Create a constant for the maximum student count per class and assign 20 to it.
- Create an integer variable to store the total number of enrolled students.
- Create a prompt for the variable in step 2.
- Calculate the number of full class rooms that are needed to support this number.
- Calculate the number of remaining students who do not make up a full class room. (Use the Modulus operator)
- Display the number of students enrolled, the number of full classrooms and the number of remaining students
Use descriptive variable names with the standard naming convention.
Below is a sample of the expected output.
Enter the number of students enrolled: 46
The class has 46 students enrolled. This requires 2 full classrooms with 6 students remaining.