Question: Done in Java: Create a class named Lab3Exercises and Implement the following static methods (we will not use this class to instantiate objects) and write

Done in Java:

Create a class named Lab3Exercises and Implement the following static methods (we will not use this class to instantiate objects) and write JUnit testswhen asked:

Done in Java: Create a class named Lab3Exercises and Implement the following

c) public static String random Grade Generator (int numAssignments) i. Write a method that accepts the number of assignments (as parameter) and then will generate a comma separated String of random grades. For example: if user wants 5 grades, program returns "A+, B-, C-, D-, F" which were generated randomly. Hint: You can use a Math.random() or Random class to generate a random number which can be used as index to access grades from a string that looks like "ABCDF". Similarly, you can choose to put a + or - with the letter grade or no sign at all. Also remember that we don't have F+, F- options in grades. ii. Test your method for different inputs. d) public static String hexTointNBin (String hexInput) i. Implement a method that converts a hexadecimal input into their binary and decimal equivalents. Your Hexadecimal input number must have Ox preceding the hex digits (hence the type string) and must have minimum of 4 hex digits. It returns a combined String in the following format. "Your number is XXXX (in decimal) and YYYY (in binary)" where XXXX is the positive integer/decimal value and YYYY is the binary equivalent number. For example: for input 0x000A, the result is: Your number is 10 (in decimal) and 1010 (in binary) Note: You may use intToBinary. HERE are two very good explanations on converting a hex value to decimal integer & binary. ii. Test your program properly and Write appropriate JUnit tests

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!