mis 307 homework 6

MIS 307 Homework 6

Review chapter 14 of the textbook and provide a text file and a source code to the following questions. For non-programming questions, write your answer in a text (*.txt), Word (*.doc, *.docx), or PDF (*.pdf) file.

For programming question, submit exactly one java source code. Non-programming Questions (10 points) R14.5b Suppose algorithm B takes five seconds to handle a data set of 1,000 records. If the algorithm B is an O(n^2) algorithm, approximately how long will it take to handle a data set of 2,000 records? Of 10,000 records?

Programming Question (30 points, modified from E14.8 from the textbook) Write a lookup program for university and zip code. Read a data set of 2700+ universities and their zip codes from the given text file (university.txt). Handle lookups by zip code (lookup_by_zip method) and also lookup by university name (lookup_by_university method). Use a binary search for both lookups. – One zip code can have multiple universities. For simplicity, you can return one university name for the given zip code. – User can enter either upper- or lower-case letters. To handle this, toUpperCase() method of String is used to capitalize the user input. – If the user input zip code does not have a university or user input university does not exists, then null will be returned by the search algorithm. Four files are provided with the assignment. 1. UnivZipLookupProgram.java: class containing main method. No modification needed. 2. Item.java: class to store an item. No modification needed. 3. LookupTable.java: core class of this assignment. Complete all methods. 4. university.txt: universities and their zip codes in the US. To help you understand how the program works, a sample run is available in Appendix A below Submit one source file (LookupTable.java). In other words, UnivZipLookupProgram.java, Item.java, or university.txt should not be submitted. In modifying the source file, 1. Do not change the file (class) names. Three Points will be deducted if you have different names. Class name changed due to Canvas (e.g., Classname(1).java, Classname(2).java) is ignored. 2. Fill in your name in the @author section of the comment in each of the files. If you do not, two points will be deducted. Submit your work to Canvas. Make sure to submit source file (*.java). Class file (*.class) will not be graded and receive zero credit.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *