Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is my code. import static org.junit.Assert.*; import org.junit.*; import java.util.*; public class StudentSortSearchTest { //@Test public static void testSort(ArrayList arrA, StudentSortSearch.SortSearchCriteria criteria){ ArrayList students

This is my code.

import static org.junit.Assert.*;

import org.junit.*;

import java.util.*;

public class StudentSortSearchTest {

//@Test

public static void testSort(ArrayList arrA, StudentSortSearch.SortSearchCriteria criteria){

ArrayList students = new ArrayList();

//Test to see if it is being sorted by name or by age

if(criteria == StudentSortSearch.SortSearchCriteria.AGE){

students.add(new Student("Mike", "Jones", 18));

students.add(new Student("Mohamed", "Ali", 19));

students.add(new Student("John", "Smith", 21));

students.add(new Student("Brittney", "Spears", 30));

assertArrayEquals(arrA.toArray(), students.toArray());

}else{

students.add(new Student("Brittney", "Spears", 30));

students.add(new Student("John", "Smith", 21));

students.add(new Student("Mike", "Jones", 18));

students.add(new Student("Mohamed", "Ali", 19));

assertArrayEquals(arrA.toArray(), students.toArray());

}

}

public static void testMergesort(ArrayList arrA, StudentSortSearch.SortSearchCriteria criteria){

testSort(arrA, criteria);

}

public static void testQuicksort(ArrayList arrA, StudentSortSearch.SortSearchCriteria criteria){

testSort(arrA, criteria);

}

public static void testBinarySearch(Student stu1){

Student stuA = new Student("Brittney", "Spears", 30);

assertEquals(stu1,stuA);

}

}

But when I run it I keep getting this error: error: cannot find symbol

How can I fix this?

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

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

Students also viewed these Databases questions

Question

Solve for x: 2(3x 1)2(x + 5) = 12

Answered: 1 week ago

Question

3. What are potential solutions?

Answered: 1 week ago