Home‎ > ‎Assignments‎ > ‎

Where Credit Is Due

Programming Assignment


Write a program that accepts input data about a certain (unknown) number of CIS students. A set of input data contains the following information for each student:

  • Student ID
  • Number of credits carried during the current semester

The CIS department wishes to know how many credits a typical student takes. Your program should calculate the average number of credits for the department.

The console window should look something like this:


This program will let you enter student data for a group students and when you are finished entering the data, the program will report to you the average number of credits per student.

For each student, enter a student ID and the number of credits the student is taking this semester.  When you wish to end, type “END” for the Student ID.


Student ID?  111222333

Number of credits for this student? 15

Student ID? END


The average number of credits for all students entered is 15 credits per student.

Run your program twice, once with no student information entered (number of students = 0), and once with the following sample data:

 000196721 15
 432109869  9
 215341242 18
 000098706  6
 375645327 15
 892476206 12
 649521656 21
 287345109 18
 124126593 9
 457368753 6
 572751827 15
 723452162 18
 312160211 6
 983265386 9