The attached file, CommonFemaleNames.txt, contains the top 1000 female names in the United States. The  format is integer string where the integer is the popularity number (1 is most popular) and string is a female  first name. The program is to read the list of names and create an array of objects. It then sorts the array in  alphabetical order. The user enters a name, which the program searches for and then reports how common  that name is. The program is to use two different search algorithms, a linear search and a binary search. It  reports on how many microseconds it takes to find the name using each method.  Requirements 1. Each name and popularity number must be stored in a separate object.  2. The names on the list are all uppercase, but the program must find the name even if it is entered in  lower case. Do this by converting

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
The attached file, CommonFemaleNames.txt, contains the top 1000 female names in the United States. The  format is integer string where the integer is the popularity number (1 is most popular) and string is a female  first name. The program is to read the list of names and create an array of objects. It then sorts the array in  alphabetical order. The user enters a name, which the program searches for and then reports how common  that name is. The program is to use two different search algorithms, a linear search and a binary search. It  reports on how many microseconds it takes to find the name using each method.  Requirements 1. Each name and popularity number must be stored in a separate object.  2. The names on the list are all uppercase, but the program must find the name even if it is entered in  lower case. Do this by converting the entered name to all caps.  3. It must give an appropriate message if the name entered is not on the list.  4. Both a linear and a binary search are required, for each name entered and the time it takes for each  one reported.  5. Either the sort or the binary search must use a recursive method (Hint: a recursive binary search is  easier than a recursive sort) Note: It works best if namePair is an array of pointers to  CommonName (My UML creator won’t let me show that)  Extra Credit • Use quicksort to sort the name objects (5 points)  • Throw an exception when a name is not found. Handle it in the calling procedure (5 points)
Name
- namePair: CommonName []
- nextname: int
+ Name()
+ addName(pair: CommonName): void
+ sortNames(): void
+ findLinear(name: string): int
+ findBinary(name: string): int
- findRecursive(name: string, low: int, high: int): void
Note: It works best if namePair is an array of pointers to
CommonName (My UML creator won't let me show that).
CommonName
- ordinal: int
- name: string
+ CommonName(ord: int, aName: string)
+ getOrdinal(): int
+ getName(): string
Transcribed Image Text:Name - namePair: CommonName [] - nextname: int + Name() + addName(pair: CommonName): void + sortNames(): void + findLinear(name: string): int + findBinary(name: string): int - findRecursive(name: string, low: int, high: int): void Note: It works best if namePair is an array of pointers to CommonName (My UML creator won't let me show that). CommonName - ordinal: int - name: string + CommonName(ord: int, aName: string) + getOrdinal(): int + getName(): string
Sample Output
C:4.
C:\Windows\system32\cmd.ex
The names have been read
The names have been sorted
Enter a female name, enter STOP to end: Pauline
Linear search took 3662 microseconds
Binary search took 118 microseconds
PAULIÑE is the number 133 most popular female name
Enter a female name, enter STOP to end: Kathyrn
KATHYRN is not on the list
Enter a female name, enter STOP to end: Jennifer
Linear search took 2222 microseconds
Binary search took 133 microseconds
JENNIFER is the number 6 most popular female name
Enter a female name, enter STOP to end: stop
Press any key to continue
Transcribed Image Text:Sample Output C:4. C:\Windows\system32\cmd.ex The names have been read The names have been sorted Enter a female name, enter STOP to end: Pauline Linear search took 3662 microseconds Binary search took 118 microseconds PAULIÑE is the number 133 most popular female name Enter a female name, enter STOP to end: Kathyrn KATHYRN is not on the list Enter a female name, enter STOP to end: Jennifer Linear search took 2222 microseconds Binary search took 133 microseconds JENNIFER is the number 6 most popular female name Enter a female name, enter STOP to end: stop Press any key to continue
Expert Solution
steps

Step by step

Solved in 8 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY