Question
JAVA. Build a database with numbers that can be sorted and searched with your program.This will have two classes; a main class and data class.
JAVA. Build a database with numbers that can be sorted and searched with your program.This will have two classes; a main class and data class.
The user will input five random numbers in the main class to be stored in a array. You must insert an instance of the data object within the main class to store the numbers array in a field of the database using its constructor.
Data Class configs:
Within the data class, use a bubble sort method that returns the data in ascending and descending. Call the method from the main and print the result.
Within the data class, use methods that will return min, max, and average. Call them from the main class and print.
Lastly in the data class, use a method that will search for a value via binary search and returns the index of the value. Call the method from the main class and print.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started