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

 

amjadm@miamioh.edu assignment3 > lightSwitch
prev  |  next  |  chance

Having 3 lights in the room, turn on and off the lights based on the given boolean values l1, l2, l3 e.g. l1 = true, l2 = false, l3 = true, so the result should be "101" where "1" represent the light on and "0" (zero) represent the light off.


lightSwitch(true, true, true) → "111"
lightSwitch(true, true, false) → "110"
lightSwitch(true, false, true) → "101"

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

public String lightSwitch(boolean l1, boolean l2, boolean l3) { }

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

Copyright Nick Parlante 2017 - privacy