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

 

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

Write a method that returns the two's complement of the binary number represented by the input parameter string. Return the two's complement as a string.


twosComplement("110000") → "010000"
twosComplement("100100") → "011100"
twosComplement("11111111") → "00000001"

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

public String twosComplement(String str) { }

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

Copyright Nick Parlante 2017 - privacy