Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program : Sort in Fraction, Due on Saturday Feb 15, 2020 30 points Please following the following instructions before turning in your USB 1. 2.

Program : Sort in Fraction, Due on Saturday Feb 15, 2020 30 points

Please following the following instructions before turning in your USB

1. 2. 3.

4.

5.

Your USB will have a label from outside under Your_LastName_FirstName Inside your USB there is a FOLDER under the name: YourLastName_FirstName_P2.

Inside the above folder,

  1. There are only the source codes. There will be NO files with suffix class.

  2. The first line in each file must bear your full name after the double slashes //

Your instructor will compile your files and run Test.class via cmd/terminal. Your must be responsible to make sure your files are standard to run properly. Your instructor WILL NOT touch your files. Your instructor will make his own Test file to evaluate all students performance.

Here is a sample of the instructions (caller) in Test.java: String s = " 2 , 3/4, 1/16, 2 3/2, 2 2/4,,,1 5/2,";//code to read from keyboard via Scanner

s = Utility.clean(s); System.out.println("CleanOrig=|" + s+"|" ); //code to create an object of Sort

SortSP obj = new SortSP(s); //SP are the initials of author System.out.println("init array of Fractions = " + obj );

obj.bubbleSP(); // sort array using bubble, insertion, or selection System.out.println("Fractions in increasing order = " + obj );

Outline of class SortSP: a. Name of class is "Sort" followed by your initials in upper cases. b. There are 2 attributes: (Note: You should not add any extra attributes)

String sSP; //name of string started with "s" followed by your initials in upper cases.

Fraction[] aSP;// name of array started with "a" followed by your initials in upper cases. c. methods:

  • resetSP: to set the second attribute to be its original, (not create any unnecassary new fractions) .

  • bubbleSP: to sort the 2nd attribute in increasing order.

  • additional methods to make the sample work Note: SP are the initials of your instructor. You need to replace they by yours.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Power Of Numbers In Health Care A Students Journey In Data Analysis

Authors: Kaiden

1st Edition

8119747887, 978-8119747887

Students also viewed these Databases questions

Question

8. Explain the contact hypothesis.

Answered: 1 week ago

Question

2. Define the grand narrative.

Answered: 1 week ago