Creating a contacts application, Computer Engineering

Assignment Help:

Creating a contacts application:

First, a contact is defined as the tuple: firstName, lastName, phoneNumber and email.

You will create a class Contact that allows getting and setting of these variables as well as a toString() method.

Second, a ContactBook class should be able to search, create, or modify a contact.

A main class (call it whatever you want) should offer a menu with options.

When adding, the input from the user is gathered and the method ContactBook.addContact(Contact c) will store that contact in memory.

If the user is searching, the program gets the user input and then calls the method ContactBook.search(String lastName). This method should return an ArrayList with all the contacts that matched the criteria. for example, a call to search("Jon") will return an array list with the contacts for "Jones" and "Jonowsky" and any other contact whose last name starts with "Jon". Your search should ignore cases.

If the user wants to modify a contact, the first thing to ask for is that contact's last name. Then the program will search based on that last name (or portion of it, just like the search functionality) using the search method defined earlier. Then the computer should display them with a number next to them (1,2,3...). Then the computer will prompt the user "Which contact do you want to modify" and will expect a number. Then it should enter into a modify screen that will ask the user to modify the values of last name, first name, phone and email. If users just presses enter, the old values are kept. If the user types in something then a new value will be set. After collecting the input of the user, your program should call a method from ContactBook called updateContact(Contact c, String firstName, String lastName, String phone, String email), where c is the contact to modify.

When the user quits (by pressing "q") or saves (by pressing "s") Your contact list should be saved as a Comma Separated values. That is, each line in the file should contain LastName,firstName,phone,email

When the program starts, if the contacts file is present, it should read it and populate the list of contacts.

The contact file should be called "contacts.csv"


Related Discussions:- Creating a contacts application

Example on cyclic distribution of data, Q. Example on Cyclic Distribution o...

Q. Example on Cyclic Distribution of data? !HPF$ PROCESSORS P1(4) !HPF$ TEMPLATE T1(18) !HPF$ DISTRIBUTE T1(CYCLIC) ONTO P1 The result of these instructions is display

How does bus arbitration typically work, How does bus arbitration typically...

How does bus arbitration typically work? i.  A bus master waiting to use the bus asserts by  the bus request. ii.  A bus master cannot be the bus until it's request is grant

Types of software - computer architecture, Types of software: A layer ...

Types of software: A layer structure is described where Operating System is located on generally used software systems on desktops   System software System sof

Show the process management for parallel virtual machine, Q. Show the Proce...

Q. Show the Process Management for parallel virtual machine? Process Management  int pvm_mytid( void ) Returns the tid of the calling process. Tid values les

At least two optional data fields, As an XML expert you are needed to model...

As an XML expert you are needed to model a system for an online furniture shop. After an interview with the shop manager you have the certain information: The detail of th

Isoquants, what are the types of isoquants

what are the types of isoquants

Row-major order and column-major order of arrays, Two-dimensional array is ...

Two-dimensional array is represented in memory in following two ways: 1.  Row major representation: To attain this linear representation, the first row of the array is kept in

What are the attributes of the method, What are the attributes of the metho...

What are the attributes of the method? During implementation a process is characterized by various attributes maintain by the system: Its state Its identification

What are the different types of bios, The  most common types are the AWARD,...

The  most common types are the AWARD,AMI, AND phoenix

Mapping design principle, The following definition of mapping is adapted fr...

The following definition of mapping is adapted from the first edition of the Set Book: Mapping concerns the relationship between controls and their effects in the world. Nearly al

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd