Programming discussion

Price: $5 USD

Question description

Download the the BlueJ project ( for this assignment and open it in BlueJ. You will see that it is composed of three classes, of which two are missing some code. You will complete that code and then extend the code in all three classes in various ways.

The program is designed to allow users to see the popularity rank of surnames (i.e., last names). It reads in a file that contains, in alphabetical order, a list of names and their popularity rank. Here is what the first few lines of the file look like:

The first line contains the number of name/rank pairs in the file, which is followed by that many name/rank pairs.

The main class is called NameLookup, and it handles all the interaction with the user. You don't have to modify anything in this file to begin, and will only make minor modifications in it later. It asks the user for the name of the data file and then creates a Surnames object, passing it that filename. It then repeatedly asks the user for a name and displays that name's rank. If the name is not found it prints out a message to that effect. You can see this in action in the screenshot attachednameLookup.gif (the indented lines are not generated yet).

The name/rank pairs are stored as SurnameInfo objects. This is a simple object that just stores that info and has getters and setters for name and rank.

The middle class is called Surnames and it stores all of the SurnameInfo objects in an array. It also has a method that returns the rank of a name if it exists and -1 otherwise. It also has a method that returns the number of SurnameInfo objects stored.


Your goal is to complete the project so users can look up the rank of various surnames. This is done by using the search algorithms discussed in class. The linear search algorithm is already present in the Surnames class - you will need to add the other two search methods. When completed the interaction with the user should look like the following.

Studypool has helped 1,244,100 students
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1823 tutors are online

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors