Computers and Technology

Part 1: getting started1. create a new java project for this lab assignment. 2. create a new class. name it lab8.3. add this code to the lab8 class. public class lab8{// sort the array//public static void main ( string[] args ){int[] values = {17, 5, 21, 8, 19, 2, 23, 15, 4, 13 }; int numvalues = 10; // print out the arraysystem. out. println("initial values: "); for ( int i=0; i < numvalues; i++ ) system. out. println( values[i]); // sort the arrayselectionsortfilm. sortit( values, numvalues ); // print out the arraysystem. out. println("\n\nsorted values: "); for ( int i=0; i < numvalues; i++ ) system. out. println( values[i]); system. out. println( ); }}4. create a new class. name it selectionsortfilm.5. add this code to the selectionsortfilm class. public class selectionsortfilm { public static void sortit( int[] array, int numberofthingstosort ){/* find the integer that should go in* each cell j of the array, from cell 0 to the end*/for ( int j=0; j film2**/public int compareto(filmtake2 f2){return (this. title. comparetoignorecase(f2.title)); }11. thought experiment: what value would compareto() return from these sample calls? filmtake2 f1 = new filmtake2("venom", 2018); filmtake2 f2 = new filmtake2("halloween", 2018); f1.compareto(f2); f2.compareto(f1); f1.compareto(f1); part 3: sorting objects12. make these highlighted changes to the selectionsortfilm class. public class selectionsortfilm {public static void sortit( filmtake2[] array, int numberofthingstosort ){/* find the integer that should go in* each cell j of the array, from cell 0 to the end*/for ( int j=0; j

answer
Answers: 3

Similar questions

Do you know the correct answer?
Part 1: getting started1. create a new java project for this lab assignment. 2. create a new class....

Questions in other subjects:

Konu
Biology, 25.05.2021 16:40