The goal for Lab07 is to use the provided Student class and create an array of Student objects that is stored in a School object. This program uses a Student class that is provided(picture attached!). The class is placed in its own separate file and should not be altered. This project started with Lab06a and uses the same Student class. Part one of Lab07 is similar to the Lab06b. The difference is that Lab06b used static 1D arrays and Lab07 uses dynamic ArrayList arrays. The output is the same.   OUTPUT  Tom  21  1.685  Ann  34  3.875  Bob  18  2.5  Jan  45  4.0  Joe  27  2.975  Sue  19  3.225  Jay  30  3.65  Meg  38  2.0  Art  40  3.999  Deb  35  2.125  Ann  34  3.875  Art  40  3.999  Bob  18  2.5  Deb  35  2.125  Jan  45  4.0  Jay  30  3.65  Joe  27  2.975  Meg  38  2.0  Sue  19  3.225  Tom  21  1.685 Bob  18  2.5  Sue  19  3.225  Tom  21  1.685  Joe  27  2.975  Jay  30  3.65  Ann  34  3.875  Deb  35  2.125  Meg  38  2.0  Art  40  3.999  Jan  45  4.0  Tom  21  1.685  Meg  38  2.0  Deb  35  2.125  Bob  18  2.5  Joe  27  2.975  Sue  19  3.225  Jay  30  3.65  Ann  34  3.875  Art  40  3.999  Jan  45  4.0 In part two, adds the linearSearch and the binarySearch methods. Each search method is tested with an existing search record and one that does not exist. Please create a bubble sort, selection sort, and insertion sort for sorting by names, gpa, and age respectively.  Student class and Main class are attached as photos

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

The goal for Lab07 is to use the provided Student class and create an array of Student objects that is stored in a School object. This program uses a Student class that is provided(picture attached!). The class is placed in its own separate file and should not be altered. This project started with Lab06a and uses the same Student class.

Part one of Lab07 is similar to the Lab06b. The difference is that Lab06b used static 1D arrays and Lab07 uses dynamic ArrayList arrays. The output is the same.

 

OUTPUT


 Tom  21  1.685
 Ann  34  3.875
 Bob  18  2.5
 Jan  45  4.0
 Joe  27  2.975
 Sue  19  3.225
 Jay  30  3.65
 Meg  38  2.0
 Art  40  3.999
 Deb  35  2.125

 Ann  34  3.875
 Art  40  3.999
 Bob  18  2.5
 Deb  35  2.125
 Jan  45  4.0
 Jay  30  3.65
 Joe  27  2.975
 Meg  38  2.0
 Sue  19  3.225
 Tom  21  1.685


Bob  18  2.5
 Sue  19  3.225
 Tom  21  1.685
 Joe  27  2.975
 Jay  30  3.65
 Ann  34  3.875
 Deb  35  2.125
 Meg  38  2.0
 Art  40  3.999
 Jan  45  4.0

 Tom  21  1.685
 Meg  38  2.0
 Deb  35  2.125
 Bob  18  2.5
 Joe  27  2.975
 Sue  19  3.225
 Jay  30  3.65
 Ann  34  3.875
 Art  40  3.999
 Jan  45  4.0

In part two, adds the linearSearch and the binarySearch methods. Each search method is tested with an existing search record and one that does not exist.

Please create a bubble sort, selection sort, and insertion sort for sorting by names, gpa, and age respectively. 

Student class and Main class are attached as photos 

1
NM 456000
2
3
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// student.java
// Used by the Labe6 and Labe7 Assignments.
public class student
{
}
private string name;
private int age;
private double gpa;
public student (string n, int a, double g)
{
name = n;
age = a;
gpa = g;
public string getName() { return name; }
public int getAge()
{ return age; }
public double getGPA() { return gpa; }
public string tostring()
{
string temp = name +
return temp;
+ age
+
+ gpa + "\n";
Transcribed Image Text:1 NM 456000 2 3 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 // student.java // Used by the Labe6 and Labe7 Assignments. public class student { } private string name; private int age; private double gpa; public student (string n, int a, double g) { name = n; age = a; gpa = g; public string getName() { return name; } public int getAge() { return age; } public double getGPA() { return gpa; } public string tostring() { string temp = name + return temp; + age + + gpa + "\n";
1
2
3
7
8
18
11
12
13
15
16
17
18
19
28
21
23
25
26
27
28
29
38
31
32
33
35
36
37
38
39
41
43
45
46
import java.util.ArrayList;
public class Main (
(
}
public static void main (String[] args)
(
System.out.println("Lab87Sort by Your Name");
System.out.println();
int size = 18;
School on now School (size);
System.out.println();
bhs.bubbleSort();
System.out.println();
bhs.selectionsort();
System.out.println();
bhs.insertionsort();
System.out.println(ow);
System.out.println(bhs. linearSearch("Meg"));
System.out.println(bhs.linearSearch("Sid"));
System.out.println();
bhs.selectionsort();
System.out.println(bs);
System.out.println(bhs.binarySearch("Meg"));
System.out.println(bhs.binarySearch("Sid"));
System.out.println();
class School
(
private ArrayList<Student students;
private int size:
public School (ints) { /* To Be Completed */ }
public void addData() { /* To Be Completed */ }
public void bubbleSort() { /* To Be Completed */ }
public void selectionSort() { /* To Be Completed */ }
public void insertionSort() { /* To Be Completed */ }
public String tostring() { /* To Be Completed */ return **; }
Transcribed Image Text:1 2 3 7 8 18 11 12 13 15 16 17 18 19 28 21 23 25 26 27 28 29 38 31 32 33 35 36 37 38 39 41 43 45 46 import java.util.ArrayList; public class Main ( ( } public static void main (String[] args) ( System.out.println("Lab87Sort by Your Name"); System.out.println(); int size = 18; School on now School (size); System.out.println(); bhs.bubbleSort(); System.out.println(); bhs.selectionsort(); System.out.println(); bhs.insertionsort(); System.out.println(ow); System.out.println(bhs. linearSearch("Meg")); System.out.println(bhs.linearSearch("Sid")); System.out.println(); bhs.selectionsort(); System.out.println(bs); System.out.println(bhs.binarySearch("Meg")); System.out.println(bhs.binarySearch("Sid")); System.out.println(); class School ( private ArrayList<Student students; private int size: public School (ints) { /* To Be Completed */ } public void addData() { /* To Be Completed */ } public void bubbleSort() { /* To Be Completed */ } public void selectionSort() { /* To Be Completed */ } public void insertionSort() { /* To Be Completed */ } public String tostring() { /* To Be Completed */ return **; }
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education