CSci 1001 Problem set 3. Due Thursday, March 8.

Problem 1: Who wins elections?

Write a program that read names of two candidates as inputs, then asks you to enter the number of votes for each person, and then prints the the name of the winner. If it's a tie, it has to say so.

For instance, the dialog with the program may go like this (using prompts to read the data):

If it's a tie, print something like "Bart Simpson and Lisa Simpson got equal number of votes".

Problem 2: A fortune-teller program

Write a program that uses a random number generator to "tell fortune":

Problem 3: Written part

Questions 13, 15, 16, 20 p 115.

How to submit

Send all of your program files to me by e-mail. You may submit the written part in class or send it together with your problem set. Please send only ONE e-mail with your entire submission, make sure you include everything. Multiple e-mails with your homework may result in lower grade.

Your programs will be graded not just on correctness, but also on the clarity of code. Appearance of the page and creativity may be taken into account.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.