Your cart is currently empty!
Everyone in computing should have a basic understanding of binary integers. To that end, you will write an app to convert decimal to binary. The application should perform as follows: The program is called and runs with no prompt for input. The first value provided to the standard input stream shall be…
Everyone in computing should have a basic understanding of binary integers. To that end, you will write an app to convert decimal to binary.
The application should perform as follows:
There are other algorithms which are easier as well as improvements to this algorithm. You should not solve this with an array (or string). That defeats the purpose of the assignment.
I provided you with a test file to test your code. You should ensure that your code satisfies the tester’s requirements. It is the tool I will use to grade your submissions. I will only change the input and expected values.
To utilize the tester, you will need access to a python3 interpreter. The tester can be called using the make file, assuming that python3 is in your path and that your present working directory is ../hw1
POINT AWARDS
Correctly converting and printing a valid value is worth 2 points. Correctly catching an incorrect number of bits is worth 12 points. Correctly catching negative decimal input is worth 12 points. Style is worth 2 points. I have provided you a make file. You should definitely read the makefile and I would encourage you to read
the python tester.
1Do not forget to check whether this exponent is less than or equal to the first integer passed to standard input. If it is outside that value, you should subtract as indicated, but not print. You should then find the next largest exponent and try again.
CSCE 240 Homework 1 Page 2 of 2
Late assignments will lose 25% per day late, with no assignment begin accepted after 4 days (100% re-duction in points).
Check your syllabus for further caveats of grading.
The End.