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

 

StarWarsEpicBattle


Write a method that determines the outcome of an epic battle in Star Wars. The input parameters will indicate how much strength each side has in lightsaber skills and in Force powers. The Force powers are twice as effective as the lightsaber skills. The side with more total points wins! If the Dark Side wins, return -1. If the Light Side wins, return 1. If they tie, return 0. For each category, the points will be zero or greater.


StarWarsEpicBattle(3, 4, 4, 3) → -1
StarWarsEpicBattle(5, 2, 3, 3) → 0
StarWarsEpicBattle(6, 1, 6, 1) → 0

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

public int StarWarsEpicBattle(int darkSideSabers, int darkSideForce, int lightSideSabers, int lightSideForce) { }

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

Copyright Nick Parlante 2017 - privacy