Question: JAVA programing Languages HW1 (5 points) 1. (1 point) A checksum is the 32-bit integer that is the sum of the Unicode characters in a

JAVA programing Languages

JAVA programing Languages HW1 (5 points) 1. (1 point) A checksum is

HW1 (5 points) 1. (1 point) A checksum is the 32-bit integer that is the sum of the Unicode characters in a file (you can get the integer sum of the Unicode characters in a string by computing the sum of the Unicode characters of each character using the function charAt(). Two identical files have the same checksum. Write a program to compute the checksum of a file that is supplied as a command- line argument. 2. (1.5 points) A combination lock has the following basic properties: the combination (a sequence of three numbers) is hidden; the lock can be opened by providing the combination, and the combination can be changed, but only by someone who knows the current combination. Design a class with public methods open and change ambae and private data fields that store the combination. The combination should be set in the constructor. 3. (1.5 points) Write a program that reads a data file containing rational numbers, one per line, stores the numbers in an ArrayList, removes any duplicates, and then outputs the sum. Note: use BigRational from jaya.math package and follow the following class outline: class RationalNumber Tester public static void main(String langs) throws EileNotFoundException private static BigRational sum(ArrayList list); private static void printList Atraxhist list, BigRational item); } 4. (1 point) Add a Square class into the Shape hierarchy, and have it implement Comparable Note: A square has only one side as data field; the class should have methods to compute the area and perimeter. Submit the .java file for each question or the links to your code in an online java compiler such as onlinegdb.com or others. HW1 (5 points) 1. (1 point) A checksum is the 32-bit integer that is the sum of the Unicode characters in a file (you can get the integer sum of the Unicode characters in a string by computing the sum of the Unicode characters of each character using the function charAt(). Two identical files have the same checksum. Write a program to compute the checksum of a file that is supplied as a command- line argument. 2. (1.5 points) A combination lock has the following basic properties: the combination (a sequence of three numbers) is hidden; the lock can be opened by providing the combination, and the combination can be changed, but only by someone who knows the current combination. Design a class with public methods open and change ambae and private data fields that store the combination. The combination should be set in the constructor. 3. (1.5 points) Write a program that reads a data file containing rational numbers, one per line, stores the numbers in an ArrayList, removes any duplicates, and then outputs the sum. Note: use BigRational from jaya.math package and follow the following class outline: class RationalNumber Tester public static void main(String langs) throws EileNotFoundException private static BigRational sum(ArrayList list); private static void printList Atraxhist list, BigRational item); } 4. (1 point) Add a Square class into the Shape hierarchy, and have it implement Comparable Note: A square has only one side as data field; the class should have methods to compute the area and perimeter. Submit the .java file for each question or the links to your code in an online java compiler such as onlinegdb.com or others

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!