Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Answer the following questions please along with the reasoning. Thanks! Linear D

ID: 3885161 • Letter: A

Question

Answer the following questions please along with the reasoning. Thanks!

Linear Data Structures, EECS 2500 Exam 1, Fall 2017 (240 points) Java Review Due Tuesday, September 19 Open book, to be done alone. No questions allowed after class on Thursday, September 14 Part 1 (40 points, 4 each) Consider the program given in Appendix 1 1. What type of sort is used in this program? 2. What is the worst-case complexity of that sort? 3. What is the type of contactlist[num entries].note ? 4. What is the type of contactlist[i]? 5. To what degree is this program "object-Oriented? 6. What happens when the input file is empty? 7. What happens when the user searches for "Smth" and the entry in the file is for the name "Smith"? 8. When the program is running, what happens when the user types the command to delete the current entry? 9. What does method nextLinen) return? mataod 10.Write a description of the method index(String Key). nextreg cn Part 2 (60 points, 10 each) Consider the program given in Appendix 2 1 What is the purpose of "nextintty"? 2. Write the piece of code for the function initValues(). The function should automatically initialize the values of an array with random integers from 0 to 99.

Explanation / Answer


Explanation : Appendix 1
Method1: addContact()
1) Takes the name as input.
a) Checks for the condition that it should lie between 1 and 6 characters
b) Checks for the name if it is present it will ask the user to enter a different name
2)Takes contact number
a)Checks for the number that it lies between the pattern given
b)Checks for valid condition or not
3) Enter notes
a)Read the notes data
Method 2: index(key)
1)Checks the input value of key
a) If key is present it returns the key else it returns -1
Method 3: DisplayContact()
1) It displays the contact name,number,notes
Method4: listAllContacts()
1) It displays all the contacts
method 5:
Sorts the contact list based on the criteria and when you click 1 it displays the contacts
Method 6:CopyphonebookFile(filename)
Writes the name,contact,notes to the output file

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote