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

 

apcsaPrimitivesCheckPositive


The parameter positive determines whether to return true when the parameter num is positive. When positive is true, return true if num is positive and false otherwise. When positive is false, return true when num is not positive and false otherwise. Zero is considered not positive.


apcsaPrimitivesCheckPositive(true, 5) → true
apcsaPrimitivesCheckPositive(true, -1) → false
apcsaPrimitivesCheckPositive(false, -3) → true

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

public boolean apcsaPrimitivesCheckPositive(boolean positive, int num) { }

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: 150 Post-solution available

Copyright Nick Parlante 2017 - privacy