ITSD 326 AUST Computer Science Worksheet
Description
You will create this assignment following the Assignment Detail instructions below.
Review the tutorial How to Submit an Individual Project.
In this assignment you will apply recursive algorithms to an array, using a Quick Sort algorithm to sort it and a recursive Binary Search to locate a specific value provided by the user. Recursion is explained in the textbook, and these additional resources can also be helpful:
Note that as with previous assignments, you will need to understand the algorithm in order to adapt it for use within a custom class. A careful study of the learning materials, including the zyBook units on recursion, will be helpful.
Creating the Project:
- Create a new project in NetBeans (use the settings “Java with Ant” and “Java Application” in the New Project wizard, on the Choose Project screen)
- Import java.util.*;
Creating the Custom Class:
- Add a Java class to the project. (New, New File, Category Java, File Type “Java Class”.) Give this custom class the name “SortSearch”. (The file “SortSearch.java” should appear in the solution alongside the supplied class.)
- Create methods to implement a Quick Sort algorithm and a recursive Binary Search algorithm within the SortSearch class.
Within the method Main() (in the provided class, not the custom class):
- Create an integer array called “nums”, with the values 4, 8, 15, 16, 23 and 42.
- Using the Quick Sort algorithm in the SortSearch class, sort the array.
- Display the contents of the array to the user in the following format (the numbers shown below must be retrieved from the array):
Sorted array:
Index 0: 4
Index 1: 8
Index 2: 15
Index 3: 16
Index 4: 23
Index 5: 42As in previous assignments, your code must retrieve these values from the array.
- Display the following text for the user: “Enter number to search for: “.
- Create an integer value named searchValue and use it to store the user’s input.
- Call a recursive Binary Search from the SortSearch class on the array to locate the index number of the value from the user’s input.
- If the search value is not found, inform the user: “Search value not found.”
- If the search value is found, inform the user of the index as follows: “Search value found in index position: ” followed by the index number.
Document your code using appropriate in-line comments. Be sure to fully document your custom class (including all methods!) as well as your Main() code. Your comments must explain how the program works to a programmer who is familiar with Java and NetBeans but has not seen this program before. your submission. Student screenshots should be similar to those shown in the LibGuide.
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."