CS 010 - Introduction to Computer Science I
Assignment 1: Class Enrollment

DUE: Friday, January 23 before 11:00pm


Collaboration Policy

This programming assignment is designed in part for us to determine how well you are able to program. Thus, every part of the program should be your own original work, and should not be substantially similar to other students' code, as well code from books, previous solutions, the web, etc. Like other skills (e.g., surgery), the only way to really learn programming is to do it yourself. Some collaboration is O.K., including discussing the general solution method, and some debugging assistance after a student has tried hard to solve the bug him/herself. We DO encourage you to work with others nearby, so if you get stuck, you can get help. But, you should not show your code to another student in order to help that student. For this assignment, copying code from another source (e.g., copy-and-paste, reading off of another's monitor, etc.) is not considered appropriate collaboration and will have severe consequences.


Turn in online to the appropriate folder for your lab section (e.g., as1_21 for students enrolled in lab section 21). Your assignment may not get graded if it gets turned into the wrong section.

Remember to add your name, login, SID (last 4 digits), lecture and lab section numbers, and email address, to the header of your program


Problem Definition:

Write a program that determines whether a class can continue to enroll students or is full. Your program should take as input the maximum number of students that can be enrolled in the class and the current number of students enrolled in the class. If the current enrollment is greater than or equal to the max enrollment, your program should output a message stating the class is full and no other students may be enrolled. If the current enrollment is less than the max enrollment, your program should output a message stating how many more students may be enrolled.

The following are 2 different sample outputs to help you design your program. The numbers in bold indicate user input.

Sample 1

     Enter the max enrollment for the class: 84
     Enter the current enrollment for the class: 74

     The max enrollment is 84.
     The current enrollment is 74.
     You may enroll 10 more students.

Sample 2

     Enter the max enrollment for the class: 60
     Enter the current enrollment for the class: 62

     The max enrollment is 60.
     The current enrollment is 62.
     The class is full.