CSC20 Project 4 For this project our aim is to create a phone book with contact...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
CSC20 Project 4 For this project our aim is to create a phone book with contact details. Individual contact information is added to the contact class. Then these contacts are added to the Phone books array list. In a phone book the contacts are arranged in ascending order of first name or last name. Hence we will sort our phone book first by "first name" and then by "last name" using sorting algorithms. Searching contacts is done alphabetically using non-recursive binary search. Steps to Follow class Contact{ 1. Create a class Contact.java use to create individual contacts. The class structure is as follows, } PhoneBook private String firstName; private String lastName; private long homeNumber; private long officeNumber; private String emailAddress; public Contact(String firstName, String lastName, long homeNumber, long office Number, String emailAddress){ // constructor setting all details } Setter methods Getter methods toString method Fa2021 class PhoneBook{ 2. Create class PhoneBook.java to create a phone book with all the contacts. The class structure is as follows, public ArrayList contacts; public PhoneBook(){ } public add(Contact c){ } // create arraylist of contacts by reading data from the file } // add contact to the array list. public toString(){ //returns the entire phone book as string public void bubbleSort(){ //Sort phonebook by first name } public void selection Sort(){ //Sort phone book by last using selection sort algorithm. public boolean binarySearch( String name){ // Search contact by last name using binary search. // return true if contact is found else false } 3. Create a driver class PhoneDriver.java and carry out the following operations, a. Create the PhoneBook. b. Read data from file Contact Details.txt. Each line has new contact info. String tokens[] = inline.split(","); tokens[0] is first name, tokens[1] is last name, tokens[2] is home phone number, tokens[3] is office phone number, tokens[4] is email address Create Contact objects for the above details and add them to the phonebook array list. It there is a "-" at the home or office number set it to 0. c. Create a menu with following options, P: Print Phonebook FirstName Bogdan BrunoApps B: Sort phone book by first name // use bubble sort L: Sort phone book by last name // use selection sort S: Search contact by last name // use binary search A: Add contact to phone book Q. Quit d. Print Phonebook - print() - Write a static function to print Phone book using the toString method of the Phonebook class e. Search contact by last name - search(String lastName) : Write this static function - it prompts user for last name and search the phone book using binary search. If contact found print its details. If contact not found print "Contact Not Found". The Output should look like below, Nigel Buddy Justin f. Add contact method add(): This method prompts the user for contact details and calls the add instance method. A. Print PhoneBook Please enter choice: A Kosta Skal Frank Zach Iman Garret g. Run all the menu options and print the results. // Note: all the functions should be carried out using the given sorting or searching algorithms only. Q Vince Willie De'Aaron Untitle Foxocument My Sao Mail (1) Pro & projec LastName docs.go HomeNumber ocum OfficeNumber Kp EmailAddress 3kDVnoNX-G Bogdanovic 8976786543 4098762541 Cabocio Dictiona 7268725426 Wisch7653627890/UW Carter 5674873628 8746539393 Cauley Harry File Edi Giles Insert Hayes Hield 100% Jackson Koufos Labissiere MasonIII Randolph Shumpert Temple 8765635624 6753452652 3246536753 4536478987 1234536745 2345673418 2344562789 9087676352 5236476540 EUn x 6085542642 Add-ons Help 6756453456 1235437845 4563454764 7645374563 7643678363 1764535290 4543647839 3456472894 9087632342 deAaronFox@xyz.com harryGiles@gmail.com nigelHayes@abc.com buddyHield@gmail.com justinJackson@abc.com kostaKoufos@gmail.com ked IIS skalLabissiere@xyz.com frankMasonIII@gha.com ogdan, E zachRandolph@abc.com imanShumpert@gmail.com 409 garretTemple@gmail.com Bruno, Cabocio,7268725426,7653627 bogdanBogdanovic@abc.com brunoCabocio@xyz.com vinceCarter@gmail.com willieCauley@acb.com Last B. Sort by first name should also print list as above with first name in ascending order C. Sort by last name should also print list as above with last name in ascending order D. Search contact by first name Please enter choice. # Enter the last name to be search : Carter BS Contact Found Please enter choice : D Enter the last name to be search: Jackson Contact Nott Found Q. Quit Please enter choice: Q Good Bye! Grading policies Comments/ JavaDoc is necessary for each class Indentation and good programming style Data validation/reading from a file using try catch exception handling Follow the assignment specifications as given Contact Details -1.txt sections 01, 04 Assignments > Programming Assignment 4 Spring 2... Bogdan, Bogdanovic, 8976786543,4098762541, bogdan Bogdanovic@abc.com Bruno, Cabocio, 7268725426,7653627890, brunoCabocio@xyz.com Vince, Carter, 5674873628,8746539393, vinceCarter@gmail.com Willie, Cauley, 8765635624,-, willie Cauley@acb.com De'Aaron, Fox, 6753452652, 6085542642, de Aaron Fox@xyz.com Harry, Giles, 3246536753,-, harryGiles@gmail.com Nigel, Hayes, -, 6756453456, nigelHayes@abc.com Buddy, Hield, 4536478987,1235437845, buddyHield@gmail.com Justin, Jackson, -, 4563454764, justinJackson@abc.com Kosta, Koufos, 1234536745,7645374563, kostaKoufos@gmail.com Skal, Labissiere, 2345673418,7643678363, skalLabissiere@xyz.com Frank, Mason III, 2344562789,1764535290, frankMasonIII@gha.com Zach, Randolph, -, 4543647839, zachRandolph@abc.com Iman, Shumpert, 9087676352, 3456472894, imanShumpert@gmail.com Garret, Temple, 5236476540,9087632342, garret Temple@gmail.com Download i Info ZOOM + X Close CSC20 Project 4 For this project our aim is to create a phone book with contact details. Individual contact information is added to the contact class. Then these contacts are added to the Phone books array list. In a phone book the contacts are arranged in ascending order of first name or last name. Hence we will sort our phone book first by "first name" and then by "last name" using sorting algorithms. Searching contacts is done alphabetically using non-recursive binary search. Steps to Follow class Contact{ 1. Create a class Contact.java use to create individual contacts. The class structure is as follows, } PhoneBook private String firstName; private String lastName; private long homeNumber; private long officeNumber; private String emailAddress; public Contact(String firstName, String lastName, long homeNumber, long office Number, String emailAddress){ // constructor setting all details } Setter methods Getter methods toString method Fa2021 class PhoneBook{ 2. Create class PhoneBook.java to create a phone book with all the contacts. The class structure is as follows, public ArrayList contacts; CSC20 Project 4 For this project our aim is to create a phone book with contact details. Individual contact information is added to the contact class. Then these contacts are added to the Phone books array list. In a phone book the contacts are arranged in ascending order of first name or last name. Hence we will sort our phone book first by "first name" and then by "last name" using sorting algorithms. Searching contacts is done alphabetically using non-recursive binary search. Steps to Follow class Contact{ 1. Create a class Contact.java use to create individual contacts. The class structure is as follows, } PhoneBook private String firstName; private String lastName; private long homeNumber; private long officeNumber; private String emailAddress; public Contact(String firstName, String lastName, long homeNumber, long office Number, String emailAddress){ // constructor setting all details } Setter methods Getter methods toString method Fa2021 class PhoneBook{ 2. Create class PhoneBook.java to create a phone book with all the contacts. The class structure is as follows, public ArrayList contacts; public PhoneBook(){ } public add(Contact c){ } // create arraylist of contacts by reading data from the file } // add contact to the array list. public toString(){ //returns the entire phone book as string public void bubbleSort(){ //Sort phonebook by first name } public void selection Sort(){ //Sort phone book by last using selection sort algorithm. public boolean binarySearch( String name){ // Search contact by last name using binary search. // return true if contact is found else false } 3. Create a driver class PhoneDriver.java and carry out the following operations, a. Create the PhoneBook. b. Read data from file Contact Details.txt. Each line has new contact info. String tokens[] = inline.split(","); tokens[0] is first name, tokens[1] is last name, tokens[2] is home phone number, tokens[3] is office phone number, tokens[4] is email address Create Contact objects for the above details and add them to the phonebook array list. It there is a "-" at the home or office number set it to 0. c. Create a menu with following options, P: Print Phonebook public PhoneBook(){ } public add(Contact c){ } // create arraylist of contacts by reading data from the file } // add contact to the array list. public toString(){ //returns the entire phone book as string public void bubbleSort(){ //Sort phonebook by first name } public void selection Sort(){ //Sort phone book by last using selection sort algorithm. public boolean binarySearch( String name){ // Search contact by last name using binary search. // return true if contact is found else false } 3. Create a driver class PhoneDriver.java and carry out the following operations, a. Create the PhoneBook. b. Read data from file Contact Details.txt. Each line has new contact info. String tokens[] = inline.split(","); tokens[0] is first name, tokens[1] is last name, tokens[2] is home phone number, tokens[3] is office phone number, tokens[4] is email address Create Contact objects for the above details and add them to the phonebook array list. It there is a "-" at the home or office number set it to 0. c. Create a menu with following options, P: Print Phonebook FirstName Bogdan BrunoApps B: Sort phone book by first name // use bubble sort L: Sort phone book by last name // use selection sort S: Search contact by last name // use binary search A: Add contact to phone book Q. Quit d. Print Phonebook - print() - Write a static function to print Phone book using the toString method of the Phonebook class e. Search contact by last name - search(String lastName) : Write this static function - it prompts user for last name and search the phone book using binary search. If contact found print its details. If contact not found print "Contact Not Found". The Output should look like below, Nigel Buddy Justin f. Add contact method add(): This method prompts the user for contact details and calls the add instance method. A. Print PhoneBook Please enter choice: A Kosta Skal Frank Zach Iman Garret g. Run all the menu options and print the results. // Note: all the functions should be carried out using the given sorting or searching algorithms only. Q Vince Willie De'Aaron Untitle Foxocument My Sao Mail (1) Pro & projec LastName docs.go HomeNumber ocum OfficeNumber Kp EmailAddress 3kDVnoNX-G Bogdanovic 8976786543 4098762541 Cabocio Dictiona 7268725426 Wisch7653627890/UW Carter 5674873628 8746539393 Cauley Harry File Edi Giles Insert Hayes Hield 100% Jackson Koufos Labissiere MasonIII Randolph Shumpert Temple 8765635624 6753452652 3246536753 4536478987 1234536745 2345673418 2344562789 9087676352 5236476540 EUn x 6085542642 Add-ons Help 6756453456 1235437845 4563454764 7645374563 7643678363 1764535290 4543647839 3456472894 9087632342 deAaronFox@xyz.com harryGiles@gmail.com nigelHayes@abc.com buddyHield@gmail.com justinJackson@abc.com kostaKoufos@gmail.com ked IIS skalLabissiere@xyz.com frankMasonIII@gha.com ogdan, E zachRandolph@abc.com imanShumpert@gmail.com 409 garretTemple@gmail.com Bruno, Cabocio,7268725426,7653627 bogdanBogdanovic@abc.com brunoCabocio@xyz.com vinceCarter@gmail.com willieCauley@acb.com Last FirstName Bogdan BrunoApps B: Sort phone book by first name // use bubble sort L: Sort phone book by last name // use selection sort S: Search contact by last name // use binary search A: Add contact to phone book Q. Quit d. Print Phonebook - print() - Write a static function to print Phone book using the toString method of the Phonebook class e. Search contact by last name - search(String lastName) : Write this static function - it prompts user for last name and search the phone book using binary search. If contact found print its details. If contact not found print "Contact Not Found". The Output should look like below, Nigel Buddy Justin f. Add contact method add(): This method prompts the user for contact details and calls the add instance method. A. Print PhoneBook Please enter choice: A Kosta Skal Frank Zach Iman Garret g. Run all the menu options and print the results. // Note: all the functions should be carried out using the given sorting or searching algorithms only. Q Vince Willie De'Aaron Untitle Foxocument My Sao Mail (1) Pro & projec LastName docs.go HomeNumber ocum OfficeNumber Kp EmailAddress 3kDVnoNX-G Bogdanovic 8976786543 4098762541 Cabocio Dictiona 7268725426 Wisch7653627890/UW Carter 5674873628 8746539393 Cauley Harry File Edi Giles Insert Hayes Hield 100% Jackson Koufos Labissiere MasonIII Randolph Shumpert Temple 8765635624 6753452652 3246536753 4536478987 1234536745 2345673418 2344562789 9087676352 5236476540 EUn x 6085542642 Add-ons Help 6756453456 1235437845 4563454764 7645374563 7643678363 1764535290 4543647839 3456472894 9087632342 deAaronFox@xyz.com harryGiles@gmail.com nigelHayes@abc.com buddyHield@gmail.com justinJackson@abc.com kostaKoufos@gmail.com ked IIS skalLabissiere@xyz.com frankMasonIII@gha.com ogdan, E zachRandolph@abc.com imanShumpert@gmail.com 409 garretTemple@gmail.com Bruno, Cabocio,7268725426,7653627 bogdanBogdanovic@abc.com brunoCabocio@xyz.com vinceCarter@gmail.com willieCauley@acb.com Last B. Sort by first name should also print list as above with first name in ascending order C. Sort by last name should also print list as above with last name in ascending order D. Search contact by first name Please enter choice. # Enter the last name to be search : Carter BS Contact Found Please enter choice : D Enter the last name to be search: Jackson Contact Nott Found Q. Quit Please enter choice: Q Good Bye! Grading policies Comments/ JavaDoc is necessary for each class Indentation and good programming style Data validation/reading from a file using try catch exception handling Follow the assignment specifications as given B. Sort by first name should also print list as above with first name in ascending order C. Sort by last name should also print list as above with last name in ascending order D. Search contact by first name Please enter choice. # Enter the last name to be search : Carter BS Contact Found Please enter choice : D Enter the last name to be search: Jackson Contact Nott Found Q. Quit Please enter choice: Q Good Bye! Grading policies Comments/ JavaDoc is necessary for each class Indentation and good programming style Data validation/reading from a file using try catch exception handling Follow the assignment specifications as given Contact Details -1.txt sections 01, 04 Assignments > Programming Assignment 4 Spring 2... Bogdan, Bogdanovic, 8976786543,4098762541, bogdan Bogdanovic@abc.com Bruno, Cabocio, 7268725426,7653627890, brunoCabocio@xyz.com Vince, Carter, 5674873628,8746539393, vinceCarter@gmail.com Willie, Cauley, 8765635624,-, willie Cauley@acb.com De'Aaron, Fox, 6753452652, 6085542642, de Aaron Fox@xyz.com Harry, Giles, 3246536753,-, harryGiles@gmail.com Nigel, Hayes, -, 6756453456, nigelHayes@abc.com Buddy, Hield, 4536478987,1235437845, buddyHield@gmail.com Justin, Jackson, -, 4563454764, justinJackson@abc.com Kosta, Koufos, 1234536745,7645374563, kostaKoufos@gmail.com Skal, Labissiere, 2345673418,7643678363, skalLabissiere@xyz.com Frank, Mason III, 2344562789,1764535290, frankMasonIII@gha.com Zach, Randolph, -, 4543647839, zachRandolph@abc.com Iman, Shumpert, 9087676352, 3456472894, imanShumpert@gmail.com Garret, Temple, 5236476540,9087632342, garret Temple@gmail.com Download i Info ZOOM + X Close Contact Details -1.txt sections 01, 04 Assignments > Programming Assignment 4 Spring 2... Bogdan, Bogdanovic, 8976786543,4098762541, bogdan Bogdanovic@abc.com Bruno, Cabocio, 7268725426,7653627890, brunoCabocio@xyz.com Vince, Carter, 5674873628,8746539393, vinceCarter@gmail.com Willie, Cauley, 8765635624,-, willie Cauley@acb.com De'Aaron, Fox, 6753452652, 6085542642, de Aaron Fox@xyz.com Harry, Giles, 3246536753,-, harryGiles@gmail.com Nigel, Hayes, -, 6756453456, nigelHayes@abc.com Buddy, Hield, 4536478987,1235437845, buddyHield@gmail.com Justin, Jackson, -, 4563454764, justinJackson@abc.com Kosta, Koufos, 1234536745,7645374563, kostaKoufos@gmail.com Skal, Labissiere, 2345673418,7643678363, skalLabissiere@xyz.com Frank, Mason III, 2344562789,1764535290, frankMasonIII@gha.com Zach, Randolph, -, 4543647839, zachRandolph@abc.com Iman, Shumpert, 9087676352, 3456472894, imanShumpert@gmail.com Garret, Temple, 5236476540,9087632342, garret Temple@gmail.com Download i Info ZOOM + X Close
Expert Answer:
Answer rating: 100% (QA)
Based on the provided project description and structure your task is to create a simple phone book application in Java Heres how you can structure your code Lets start with the Contact class java publ... View the full answer
Related Book For
Project Management The Managerial Process
ISBN: 9781260570434
8th Edition
Authors: Eric W Larson, Clifford F. Gray
Posted Date:
Students also viewed these programming questions
-
A simple random sample of size n = 36 is obtained from a population that is skewed right with = 77 and (a) Describe the sampling distribution of X. (b) What is P (x79.6)? (c) What is P (x72.9)? (d)...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
Corporation Growth has $83,000 in taxable income, and Corporation Income has $8,300,000 in taxable income. (Refer to Table 2.3) What is the tax bill for each firm? Suppose both firms have identified...
-
Consider the subspace W = {u(a) = 0 = u(b)} of the vector space C0[a, b] with the usual L2 inner product. (a) Show that W has a complementary subspace of dimension 2. (b) Prove that there does not...
-
Alpha Manufacturing Inc. is considering whether to invest in a new project. The project involves setting up a manufacturing facility to produce a new product line. The initial investment required for...
-
An experienced senior auditor was assigned to investigate a possible fraudulent situation characterized by extremely high, unexplained merchandise shortages at one location of the companys department...
-
Smart Company identifies the following items for possible inclusion in the taking of a physical inventory. Indicate whether each item should be included or excluded from the inventory taking. (a)...
-
What are the five forces that determine an industry's profitability?
-
Define the strings Fn (n 1) as follows: Thus, for example, we find F3 = 10, F4 = 101, and so on. (a) Prove that no Fi contains either 00 or 111 as a substring. (b) Guess the relationship between...
-
In what ways did the ideas of John Locke influence theDeclaration of Independence? How was the English Bill ofRights reflected in the U.S. Bill of Rights?
-
What role does stakeholder analysis and engagement play in the successful execution of complex projects, and how can project managers navigate competing interests to achieve project objectives ?
-
Board of Education All of these responses are correct Decreased civil rights for racial minorities Increased the power of the national government at the expense of the states Limited the Tenth...
-
How can project managers leverage advanced risk management methodologies to anticipate potential disruptions, mitigate uncertainties, and ensure project continuity ?
-
What is register transfer and what is micro-operation?
-
A perpetual preferred stock's price is $104.78 per share. If its par value is $100 per share and the dividend rate is 5.5% per year, what annual return do investors require?
-
You are the newly appointed tax practitioner to complete Emilys tax return and have downloaded the prefill report for Emilys tax return (hint, you can read what a prefill report is here (Links to an...
-
What benefits did Frontier Airlines obtain by using a weighted scoring scheme to assess the value of projects?
-
What was Sally able to achieve by holding a wake for the canceled project?
-
What similarities do you see between the Ford Diesel team and the Mac team at Apple and the Skunk Works at Lockheed?
-
Jason Edson and Peggy Karam agreed to liquidate their partnership on April 30 of the current year. On that date, after financial statements were prepared and closing entries were posted, the general...
-
Scott Badger and Maxine Giesen are partners in a business. On December 31 of the current year, the partners equities are Scott, \($60,000.00\) and Maxine, \($90,000.00.\) The net income for the year...
-
Jeffrey Lowe and Mona Ray are partners in a business. Statement paper, page 12 of a general journal, and a portion of the partnership's completed work sheet for the year ended December 31 of the...
Study smarter with the SolutionInn App