Question: Write a C ( or Python or Java ) program, call it binaryArithmetic with the following requirements: the programs take 3 space - separated string
Write a C or Python or Java program, call it binaryArithmetic with the following requirements:
the programs take spaceseparated string arguments, ie a binary number, an operator or and a binary number.
the program parse each of the three argument and, in case any of them is not valid, prints an error message and exits. This parsing of binary numbers should be done in a separate function, called int parsechar
If the operator is the second binary number is transformed into its corresponding s complement. This operation should be done in a separate function, called void getComplementchar
The addition of the two binary strings is performed in another function called void Addchar num char num char result
Finally, your program should print the result in the following format: num op num result, eg
For simplicity, assume you are dealing with bit signed numbers in the range of
Test runs:
$ binaryArithmetic call without arguments
$ Usage: binaryArithmetic Binary Binary
$ binaryArithmetic
$
$ binaryArithmetic
$ Illegal character in binary string.
I need in java please and solve all required points and also attach output screen shot
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
