Question: 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

 3. (1.5 points) Write a program that reads a data file

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 java.math package and follow the following class outline: class Rational Number Tester public static void main (String [] args) throws FileNotFoundException private static BigRational sum(Arrahist list); private static void printListlArraxhist list); private static bealean list ContainsArraxhist 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!