about | help | code help+videos | done | prefs |
Write a method that accepts three bits of a binary number as Boolean input parameters. Bit 0 is the least significant bit (the one's place). Bit 1 is the 2's place and bit 2 is the 4's place. Return an integer that has the value of that binary representation. So, for example, if bit2 is 'true'; bit1 is 'true' and bit0 is 'false' that represents the binary number 110. That number has a decimal value of 6, so you would return a 6. Look at the test data for additional examples. Please only use ONE return statement! (This means you will need to make a variable to temporarily store the results). fromBinaryUCF(false, false, false) → 0 fromBinaryUCF(false, false, true) → 1 fromBinaryUCF(false, true, false) → 2 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 100
Copyright Nick Parlante 2017 - privacy