CSCI605 Week 2 Assignment 1 solution


Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment


5/5 - (6 votes)

Your assignment is to create a calculator that performs a summation given two inputs as binary strings. The binary strings should be accepted as command line arguments.

The output of the program should display the correct summation in a binary representation, a decimal representation, and as hex.

You binary string representation output should prepend any necessary zeroes up to the nearest byte as necessary to represent the output. For example, decimal 8 should not be represented in binary as 1000, it should be 00001000.


Example output


$ java BinarySum 101101 111000

Adding 45 + 56

Sum in binary:    b’01100101′

Sum in decimal: 101

Sum in hex:         0x65


Your file should be named


You may not use any existing libraries to do any of the conversions. Graders will be looking at your implementations.


You may only use basic java types.


Correctness: You can lose up to 20% if your solution is not correct
Quality: You can lose up to 20% if your solution is poorly designed
Testing: You can lose up to 20% if your solution is not well tested
Explanation: You can lose up to 40% if you cannot explain your solution during the grading session