Question: Write a database manager that can store and work with a table of strings. It could be used to store a class list. Your

Write a "database manager" that can store and work with a table   
of strings. It could be used to store a class list. Your

Write a "database manager" that can store and work with a table of strings. It could be used to store a class list. Your program should consist of two classes: Database class. This class should store the array (table) as a field and provide the following methods: " " " Database(int size) - A one-argument constructor which accepts the size of the table (array). It should use this size to allocate (create) the array add(int index, String value) - Set the value of the array entry at the specified index. print() - Print the contents of the array sort() - Sort the contents of the array in ascending numerical order (Hint: use the Arrays class) find(String value) - Search for a particular string in the array. If it is found print out "Entry found", otherwise print out "Not found". The Database class should not have a main() method (cont'd next page) Review Ex 12: Simple Database (cont'd) DatabaseTester class. This class uses and tests your Database class. It should contain just a main method which does the following: 1. Create a Database object of size 10. Instead of the actual number 10 you should use a constant (final) field. 2. Prompt the user to enter strings (lines of text) to add to the table. Input 10 strings and add them using the 'add' method of the Database class. 3. Print out the resulting table using the Database 'print' method. 4. Sort the database by calling the the 'sort' method. 5. Print the table again to show the sorted strings. 6. Display whether the database contains your name using the 'find' method. Don't use static' except for the main() method declaration and final fields

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!