CSC 160 - Computer Programming for Non-majors

Assignment #4 - How many seats are left in the class?

Due Tuesday. September 22, 2015

You work for the Registrar's office and have to know if there are any seats available in a classroom and if so how many?

Write a program that reads two (2) inputs: the number of students in a class and the number of total seats in the classroom.

If there are still available seats in the classroom, print the number of available seats. If there aren't any seats available, print a message to that effect.

Extra credit:Please make sure that your program checks for bad data, i.e., that neither the number of students nor the number of seats is negative.

[Back to the Assignment List]