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

 

littleGame


Write a method that plays a very small and simple game. Basically the game works like this. You pass a String into the method. If the String says "heal me" the method returns "you just healed yourself to death.". If the String says "fight the dragon" the method returns "Watch it Trebek!". Any other input String returns "K.W. is a super awesome wonderful person, and NO I am NOT being ironic!". Note that the method is NOT case sensitive.


littleGame("heal me") → "you just healed yourself to death."
littleGame("fight the dragon") → "Watch it Trebek!"
littleGame("Heal Me") → "you just healed yourself to death."

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

public String littleGame(String in) { }

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

Copyright Nick Parlante 2017 - privacy