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

 

gaurav.gupta@mq.edu.au variables > eitherTrue
prev  |  next  |  chance

Define a function that when passed two boolean values, returns true if either one of them is true, false otherwise.

Note: you can return a boolean expression and hence you don't need to have conditions here.

For example:

return 5 == 8; //will return false
return 8*2 == 4*4; //will return true
return a > b; //will return true if a is more than b, false otherwise

eitherTrue(false, false) → false
eitherTrue(false, true) → true
eitherTrue(true, false) → true

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

boolean eitherTrue(boolean a, boolean b) { }

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

Copyright Nick Parlante 2017 - privacy