id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

soweigel@smsd.org ap-comp-sci > votes
prev  |  next  |  chance

Given an int vote for a candidtate, return the name of the candidate according to the following rules: (1 is for Obama) (2 is for Biden) (3 is for Clinton) (4 is for Gore) (5 is for write-in) Any other vote is invalid. You must use a switch statement.


votes(-999) → "Invalid"
votes(3) → "Clinton"
votes(5) → "Write-in"

...Save, Compile, Run (ctrl-enter)

public String votes(int vote){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100

Copyright Nick Parlante 2017 - privacy