• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Project Help

Donald Dalton
Posts: 4
  • Mark post as helpful
  • send pies
  • 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):

import java.io.*;

public class Contact
String firstName;
String lastName;
String eMail;
String phoneNum;
BufferedReader dataIn = new BufferedReader (new InputStreamReader(System.in));

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:
import java.io.*;

public class Project2 {

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

String a = "Add";

BufferedReader dataIn = new BufferedReader (new InputStreamReader(System.in));

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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic