CS2110-Homework 2 Bitwise Operators and ASCII Solved
Objective 1. To understand the bitwise operators
2. To use bitwise operators to complete tasks
3. To understand ASCII
2 Instructions 1. Make sure all 4 files are in the same folder:
(a) Bases.java
(b) Operations.java
(c) BitVector.java
(d) hw2checker.jar
2. Open a terminal / command prompt and navigate to the folder that all the files are in.
3. Run the following command to see your grade for BitVector.java:
java -jar hw2checker.jar -g BitVector.java
4. It should show all the test cases you are failing and give a 0/45 score.
5. Implement one of the functions in BitVector.java and re-run step 3 until you get full credit for that part of BitVector.java.
Now complete all the other methods in each of the 3 files based on their comments. Run the verifier and autograder frequently to avoid errors and to make sure you are using only the allowed operations.
Note: We have included an Examples.java file which shows and explains examples of two methods similar to those used in your assignment, which may be useful if you get stuck or confused at any point.
3 How to run the auto-grader & verifier 1. Make sure that the hw2checker.jar file is in the same folder as your Bases.java, BitVector.java, and Operations.java files.
2. Navigate to this folder in your command line.
3. Run the desired command (see below).
3.1 Commands Test all methods and verify that no banned operations are being used (all 3 files):
java -jar hw2checker.jar
Note: Your grade will be dependent on the output of the above command, as it will both test the output of your methods, and verify that you are not using banned operations. If you get stuck though, you can use some of the below commands to help you debug.
On Windows and Mac, you can also double click the hw2checker.jar in your file explorer to test and verify all 3 files. The results will be placed in a new file called gradeLog.txt. Any errors with compilation, infinite loops, or other runtime errors will be placed in a new file called errorLog.txt.
Test & verify all methods in a single file (using Bases.java). Useful for when you just want to look at one file at a time. For example:
java -jar hw2checker.jar -g Bases.java
Test all methods in a single file without running verifier (using Bases.java). This means that this will only run the unit tests, and will not check for the use of banned operations. Useful for when you just want to try and get something that works. For example:
java -jar hw2checker.jar -t Bases.java
Verify all methods in a single file without running tests (using Bases.java for example):
java -jar hw2checker.jar -v Bases.java
Any combination of files can also be graded, tested, or verified at the same time. For instance, Bases and Operations can be graded simultaneously as follows: