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

 

jebbert@volusia.k12.fl.us > parkourWinner
prev  |  next  |  chance

Parkour players sometimes compete against each other. Write a method that returns a code indicating which player "wins" by having the higher score. The code is -1 if the first player wins, 1 if the second player wins, and 0 if the players tie.


parkourWinner(56, 43) → -1
parkourWinner(23, 23) → 0
parkourWinner(81, 90) → 1

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

public int parkourWinner(int score1, int score2) { }

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: 290

Copyright Nick Parlante 2017 - privacy