about | help | code help+videos | done | prefs |
Wriet a method that is passed in three booleans which represent the state of binary digits. Return an integer representation of that binary number. For example, flagCode(true, true, false) returns a 6 because the binary number 110 in base 2 represents the decimal number 6. Recall that the first three digits in base 2 represent the 4's place, the 2's place, and the 1's place. So 110 means 4+2+0 which is 6. flagCode(false, false, false) → 0 flagCode(false, false, true) → 1 flagCode(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: 250
Copyright Nick Parlante 2017 - privacy