Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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+"|" ); //Outputs: "2,3/4,1/16,2 3/2,2 2/4,1 5/2"

SortSP obj = new SortSP(s);

System.out.println("init array of Fractions = " + obj ); //Outputs: "2,3/4,1/16,7/2,5/2,7/2"

obj.bubbleSP(); // sort array using bubble, insertion, or selection

System.out.println("Fractions in increasing order = " + obj ); //Outputs: "1/16,3/4,2,5/2,7/2,7/2"

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

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students also viewed these Databases questions

Question

Evaluate 3x - x for x = -2 Answer:

Answered: 1 week ago

Question

What is group replacement? Explain with an example. (2-3 lines)

Answered: 1 week ago

Question

1. Select the job or jobs to be analyzed.

Answered: 1 week ago