FirstLab-BuildingSurvey

FirstLab-BuildingSurvey - 15-121: Introduction to Data...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 15-121: Introduction to Data Structures Exercise 08/27/2009 Relevant Reading: • Chapters 1-5 of the online text by Eck. • Basics in Java notes linked from course calendar. • Readings about Java basics in other references you may have (eg. the Pohl download) First Lab Exercise (Building Survey) Fall 2009 Due: Thu, Aug 27 end of lab Assignment: (worth 5 exercise points) Imagine standing on The Cut with a clipboard asking people what their favorite building on campus is. Then you go back to your computer and type in the results. Write a program to help tally the results . Your program should: Ask the user for the day of the week. Ask the user how many votes were cast. Ask the user to enter the votes (one vote per entry). Report the results of the vote. Sample: (user input in bold) What day is it?: Thursday How many votes were cast: 8 What were the votes: --> Gates --> Hillman --> Hillman --> Gates --> Wean --> Hillman --> Hillman --> Gates RESULTS: On Thursday, there were 4 votes for Hillman and 3 votes for Gates and 1 vote for others. You may assume that only "Hillman" and "Gates" are valid votes. Handin: • Create a zip file containing all of the necessary java files. Submit this zip file via handin. If you have problems, contact me. ...
View Full Document

Ask a homework question - tutors are online