Question: need help finishing my code in JAVA. can you please update my code and add comments to EVERY line so that i can onow what

need help finishing my code in JAVA. can you please update my code and add comments to EVERY line so that i can onow what it does., please also finish it since i am struggling. this is a beginner level skill code  need help finishing my code in JAVA. can you please update
my code and add comments to EVERY line so that i can

This assignment will be submitted through codepost.ie. Please check your email for information about creating an account there. If you need help with it, please let me know. For this assignment, please create a java class called BitFiddling Practice. It should have four methods. 1. public static int getFourthLeast SignificantBit(int x) This should return the value of the fourth least significant bit of x (which will have value either 0 or 1). 2. public static int getMostSignificantBit(int x) This should return the value of the most significant bit of x (which will have value either O or 1). 3. public static int setFourthLeastSignificant BitToOnefint x) This should return x except that if its fourth least significant bit was not already 1, it should now be changed to 1. The other bits should stay the same. 4. public static int getThreeLeastSignificant Bitslint x) This should return a number between 0 and 7 representing the three least significant bits from x When you upload it to codepost.io, it will automatically compile your code and run 10 tests on your code. Each of these tests is worth 10 points. If you do not get all of the points you would like you can fix your code and resubmit. I highly recommend doing this. Each of the tests describes the input being used and the expected output, so if a test fails, you should be able to use that information to debug your code You may implement this however you want in Java (use of the operations we covered is highly recommended), except that you may not check for the input values. For example, if the test says that it is looking for the fourth least significant bit of Oxf3 and expecting a result of O, you may not write "if (x==Oxf3) return 0;" Code which does this will receive no points. O Weed public class BitFidilingPractice { public static void main (String[] args) // int number = 0x8; int numi - 273; System.out.println(getFourthLeastBit(0x8)); System.out.println(getMostSignificantBit(0x0a37 2bff)); System.out.println(setFourthLeastSignificantBit ToOne (0x702)); public static int getFourthLeastBit(int *) { int num - (6(1); return num; } public static int get MostSignificantBit(int x) { int num-(int) (Math.log(x) / Math.log(2)); return 1 return num; public static int get ThreeLeast significantBits(int x) { return x; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!