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

 

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

Write a method that accepts an integer parameter as input. Under most conditions simply return that value increased by one. However, if the input parameter is 3, return a 5. If the input parameter is 4, return a 0.


countMPHG(2) → 3
countMPHG(1) → 2
countMPHG(3) → 5

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

public int countMPHG(int current) { }

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

Copyright Nick Parlante 2017 - privacy