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

 

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

Write a method that accepts 3 boolean variables. The methods returns the number of these variables which have the value of 'true'. So if any two of the booleans are true and the other one is false, return 2. If all of them are true return three. For more examples, look at the test data.


quiz2020_09_21_APP1SLHL_howManyTrue(true, true, true) → 3
quiz2020_09_21_APP1SLHL_howManyTrue(true, false, false) → 1
quiz2020_09_21_APP1SLHL_howManyTrue(false, true, true) → 2

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

public int quiz2020_09_21_APP1SLHL_howManyTrue(boolean b1, boolean b2, boolean b3) { }

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