Class Participation Manager Solution



Your professor wants to make sure that everyone in class has a chance of actively participating in the class discussion. The plan is to randomly choose someone from the class roll to answer questions or make comments.

Your professor knows that you are in a CS class, so they ask you to create a program to help them out. Of course, you agree.


Write a program that randomly chooses names from a text file full of names. The program must have these features:

The name of the text file must given by the user.

The program must display one name at a time, and wait for the user to before displaying another.

The program must continue until the user wants to quit.

The text file has one student name per line.

Potential Sessions



Welcome to Participation Manager!

I’ll read your roll file and randomly pick

students for you.

What is the name of the roll file? roll.txt


q to quit:


q to quit:


q to quit:


q to quit:


q to quit:


q to quit:


q to quit:


q to quit:


q to quit:


q to quit:


q to quit: q


Extra Challenges

These challenges are ideas for extra features you could add to your application. They are not required for credit, but recommended for fun.

Allow the user to say if the student was present in class. When the program ends, display a list of all students who were not present when called on.

When the program ends, display how many times each student was called on.

Show Off Your Work

To receive credit for this assignment, you must show your source code and demonstrate your running program.

Ask your instructor who they would like you to show the assignment to.

Last Updated 11/04/2015

error: Content is protected !!