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:
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
-
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...
-
Using the News Wire "Law of Demand," answer the following questions: (a) According to the News Wire, what would be the response of students to a tax on alcohol that raises the price of alcoholic...
-
The mass, m grams, of a radioactive substance is given by the formula m = m 0 e kt , where t is the time in days after the mass was first recorded and m 0 and k are constants. The table below shows...
-
On March 13, 2009, Juan Mendez Sr. was admitted to a nursing facility. On that day, a doctor employed by the facility determined the father lacked the capacity to give informed consent or make...
-
Astro Co. sold 20,000 units of its only product and incurred a $ 50,000 loss (ignoring taxes) for the current year as shown here. During a planning session for year 2014s activities, the production...
-
Calculate inventory amounts when costs are declining During the year, Hooker Incorporated has the following inventory transactions. Date January 1 Transaction Beginning inventory March 4 Purchase...
-
The three A-36 steel wires each have a diameter of 2 mm and unloaded lengths of L AC = 1.60 m and L AB = L AD = 2.00 m. Determine the force in each wire after the 150-kg mass is suspended from the...
-
Consider the changing social constructions of race over time suggested by the Census Bureau categories. What do you make of them? Which categories make sense to you and why? How do those categories...
-
8. A real-time flight simulator spends 57% of the time computing latitude, longitude, altitude, attitude, bearing angle of attack, air speed, and other relevant simulation variables. The remaining...
-
Lewis Inc. has sales of $3,600,000 per year, all of which are credit sales. Its days sales outstanding is 42 days. What is its average accounts receivable balance? Assume 360 days per year.
-
What is venue shopping? Explain.
-
AT the local smoothie stand, a survey showed that 2/3 of all people preferred strawberry smoothies over the mango smoothies. If 2.400 people responded to the survey, how may prefer the mango...
-
Let g(x) = x sin(x). Find g'(x) and g(x). cos(8)sin (8) g'(x) H g(x) = 2 cos (0) 0 sin(8)
-
Discuss the common sources of risk on IT (Information Technology) projects and suggestions for managing them. Which suggestions do you find most useful? Which do you feel would not work in your...
-
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?
-
In 2018, Germany had the worlds largest current account surplus of US$291 billion. Using this one piece of information, answer the following questions. a. Which was greater, the income Germans earned...
-
In the first quarter of 2019, the output gap in the United States was 0.8%. Make a prediction about what you think the output gap will be in the second quarter of 2019. Explain your reasoning.
-
Around $500 billion in U.S. Treasuries are traded each day and many countries hold U.S. Treasuries, as they are considered a very safe investment. For example, as of October 2018, Japan held $1,018.5...
Study smarter with the SolutionInn App