Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is all supposed to be written in Java. This is the Grading Rubric. Instructions: For this assignment, you will implement the sequential and binary
This is all supposed to be written in Java.
This is the Grading Rubric.
Instructions: For this assignment, you will implement the sequential and binary search algorithms on a collection of contacts. 1. Create a new project called 08.03 Assignment in your Module 08 assignments folder. 2. Create an implementation class to define an entry within a contacts list. a. Establish instance variables for the entry's name, relation to you, birthday, phone number, and email address. b. Set up a constructor for a contact entry that will initialize all the instance variables. c. Create appropriate methods, including a toString method that returns a string with all of a contacts information. d. Add any additional attributes or behaviors you feel are appropriate (optional). 3. For this project, you will create a tester class that declares an array of people within your contact list, and makes use of methods to search the data. 4. Declare an array of at least 10 people in a contacts list. Please do not use real phone numbers, birthdates, or email addresses. Be sure to have some repeated values, such as a relationship to you and birth months. For example: Diana Prince, aunt, Oct 25, 321-555-0811, wonderwoman@theamazon.net 5. Design a static method that traverses through the array and prints all the contacts in a table format. 6. Since the data will need to be sorted prior to conducting a binary search, create sort methods for name and relationship values. a. You may use the insertion, selection, or merge sort, but not a bubble sort. b. Name and document the methods to clearly indicate the type of sort and the values being sorted. c. Utilize print debugging statements to ensure the sorts worked. Be sure to comment these out prior to submitting your work. 7. Create the following static methods in the tester class. Utilize the sequential and binary search algorithms as indicated. a. a binary search method that searches the array for a particular name b. a binary search method that searches the array for a relationship. The output should list all contacts with the same relationship, such as friend or aunt. Create a linearPrint method to assist in finding all occurrences c. a sequential search method that searches the array for all birthdays in the specified month. Hint, substrings will help you when looking for matches d. a sequential search method that searches the array for all contacts with the same phone number e. a sequential search method that searches the array for all instances of a particular email address 8. Test your search methods by calling each and displaying the results. Start by showing the original array. Then demonstrate searching for a name; showing results when a name is found and when not found. Do the same for each of the other types of values associated with a contact. Include searches that should find more than one match. Remember, for birthday searches you are actually searching for month (i.e. Mar, May, Apr, etc.). Be sure to clearly label your output so someone looking at it knows which search criterion was applied each time. 08.03 Challenge Program Grading Rubric Points Possible Components Points Earned Comments included for name, date, and purpose of the program. 1 An implementation class for a contact entry that includes instance variables, a constructor, and appropriate methods including toString 4 A tester class with an array of people in a contact list. 3 A rrethod to print all the objects in the array. 2 Create sort methods to sort the array on name and relationship 4 Create a binary search method to find a name 4 Create a binary search method to find all instances of a relationship that calls a linearprint method. 4 Create a sequential search method to find all instances of a birth month. 4 Create a sequential search method to find all instances of a phone number. 3 Create a sequential search method to find all instances of an email address, 3 Search methods invoked and run properly when search criterion is found and not found 3 Output is clearly labeled, formatted, and accurate 2 No compiler errors. No runtime errors. 2 Instructions: For this assignment, you will implement the sequential and binary search algorithms on a collection of contacts. 1. Create a new project called 08.03 Assignment in your Module 08 assignments folder. 2. Create an implementation class to define an entry within a contacts list. a. Establish instance variables for the entry's name, relation to you, birthday, phone number, and email address. b. Set up a constructor for a contact entry that will initialize all the instance variables. c. Create appropriate methods, including a toString method that returns a string with all of a contacts information. d. Add any additional attributes or behaviors you feel are appropriate (optional). 3. For this project, you will create a tester class that declares an array of people within your contact list, and makes use of methods to search the data. 4. Declare an array of at least 10 people in a contacts list. Please do not use real phone numbers, birthdates, or email addresses. Be sure to have some repeated values, such as a relationship to you and birth months. For example: Diana Prince, aunt, Oct 25, 321-555-0811, wonderwoman@theamazon.net 5. Design a static method that traverses through the array and prints all the contacts in a table format. 6. Since the data will need to be sorted prior to conducting a binary search, create sort methods for name and relationship values. a. You may use the insertion, selection, or merge sort, but not a bubble sort. b. Name and document the methods to clearly indicate the type of sort and the values being sorted. c. Utilize print debugging statements to ensure the sorts worked. Be sure to comment these out prior to submitting your work. 7. Create the following static methods in the tester class. Utilize the sequential and binary search algorithms as indicated. a. a binary search method that searches the array for a particular name b. a binary search method that searches the array for a relationship. The output should list all contacts with the same relationship, such as friend or aunt. Create a linearPrint method to assist in finding all occurrences c. a sequential search method that searches the array for all birthdays in the specified month. Hint, substrings will help you when looking for matches d. a sequential search method that searches the array for all contacts with the same phone number e. a sequential search method that searches the array for all instances of a particular email address 8. Test your search methods by calling each and displaying the results. Start by showing the original array. Then demonstrate searching for a name; showing results when a name is found and when not found. Do the same for each of the other types of values associated with a contact. Include searches that should find more than one match. Remember, for birthday searches you are actually searching for month (i.e. Mar, May, Apr, etc.). Be sure to clearly label your output so someone looking at it knows which search criterion was applied each time. 08.03 Challenge Program Grading Rubric Points Possible Components Points Earned Comments included for name, date, and purpose of the program. 1 An implementation class for a contact entry that includes instance variables, a constructor, and appropriate methods including toString 4 A tester class with an array of people in a contact list. 3 A rrethod to print all the objects in the array. 2 Create sort methods to sort the array on name and relationship 4 Create a binary search method to find a name 4 Create a binary search method to find all instances of a relationship that calls a linearprint method. 4 Create a sequential search method to find all instances of a birth month. 4 Create a sequential search method to find all instances of a phone number. 3 Create a sequential search method to find all instances of an email address, 3 Search methods invoked and run properly when search criterion is found and not found 3 Output is clearly labeled, formatted, and accurate 2 No compiler errors. No runtime errors. 2
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