CS139 Algorithm Development |
Purpose: This application will simulate a simple
voting booth. This PA is optional and may take the place of a bad grade
in PAs 1-4. It may not substitute for PA6.
private
attributes. You should not add any other attributes to this file.
int allen
int webb
int other
String voteGetters
allen
attribute by one.webb
attribute
by one.Allen: 3
Webb: 4
Other: 2
Mickey Mouse, James Madison
"Enter a for Allen, w for Webb, o for other, x to exit: "
x
is entered, output a newline character, then display the results ov the election(call the
Vote object's toString
method) and terminate the program.a
- call the voteAllen method using your Vote
object.
w
- call the voteWebb method using your Vote object.
o
- Prompt for the name of the "write-in" candidate,
using the String, "Enter the name: "
. Read that value and
pass it to the voteOther method using your Vote object.
anything other than x, a, w, o - reenter the prompt and reread the result.
Written 11/28/2010 (nlh)