Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

Project Help

Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.

I am in urgent need of some help with an assignment.

Here are the requirements:
I am to write a console program that maintains a contact database. The
program should consist of at least two classes.

One class named Contact that will be used as an abstract data type for the
contact information. This class will contain fields for a person's first name
last name, email address, and phone number.

A second class named Project2 which will create an array of contacts. The program should present the user with the ability to:
Generate a numbered list of contacts
Add a new contact
Delete a contact by number

Each operation should be implemented as a seperate method in the Project2 class. No more than 20 contacts.

Any help will be greatly appreciated. I have been working on this assignment for 2 weeks and it is due in a couple days. I have created class Contact (not sure if this is right):


public class Contact
String firstName;
String lastName;
String eMail;
String phoneNum;
BufferedReader dataIn = new BufferedReader (new InputStreamReader(;

public Contact() throws IOException

System.out.print("Enter First Name: ");
firstName = dataIn.readLine();
System.out.print("Enter Last Name: ");
lastName = dataIn.readLine();
System.out.print("Enter eMail Address: ");
eMail = dataIn.readLine();
System.out.print("Enter Phone Number: ");
phoneNum = dataIn.readLine();


And here is what I have for the Project2 class:

public class Project2 {

public static void main(String args []) throws IOException

String a = "Add";

BufferedReader dataIn = new BufferedReader (new InputStreamReader(;

System.out.println("\tContact Database");
System.out.print("Enter Add to add new contact" + "\nDelete to delete contact" +
"\nList to list contacts" + "\nor Exit to exit program:");
String cmdLine = dataIn.readLine();

} // end main method

} // end class Project

I'm probably way off but this is my first time taking a Java class. I haven't even written 50 lines of code, so I know I've got a long ways to go but don't even know if I've begun correctly or where to go next. Again, this is urgent. Thank you very much for any help.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic