Results 1 to 1 of 1
Thread: BlueJ Project
- 04-09-2014, 11:33 PM #1
Member
- Join Date
- Mar 2014
- Posts
- 3
- Rep Power
- 0
BlueJ Project
I am new to Java programming. I'm studying IT and Java programming is required. I have a project due in a little over a week. Here are the requirements:
Create a BlueJ project that maintains a student, faculty and staff directory. Your project should be able to add new entries, update entries and print the entries alphabetically by name. In addition, you should be able to remove an entry or print an entry given the entry name.
Assume the entries have the following fields:
All Persons
First name
Last name
Email address
Students
Class (e.g. freshman, sophmore, junior, senior)
Staff
Office
Title (e.g. Mr., Ms.)
Faculty
Office
Tenured (Boolean)
The directory should contain these methods:
Add person
Print all people (alphabetically by name)
Print just Students
Remove a person
Retrieve a person
You should develop an hierarchical class structure that minimizes duplication among the classes. Each class should overload the toString() method to produce an appropriate String to be used as the directory listing. The listing should be produced by iterating through the Collection of entries, using the toString() method to print each entry. Since you want to display the directory alphabetically, you might consider using a Tree Map Collection to store your database, creating the key by concatenating the last and first name. To facilitate implementation of the remove and retrieve methods, add a getter method to the Person class to return the key of the object.
I have created the following in BlueJ:
Here is the code I currently have under each class. For the Person class:
Java Code:/** * Write a description of class Person here. * * @author () * @version () */ public class Person { private String firstname; private String lastname; private String email; /** * Constructor for objects of class Person */ public Person() { } /** * An example of a method - replace this comment with your own * * @param y a sample parameter for a method * @return the sum of x and y */ }
Java Code:/** * Write a description of class Students here. * * @author (your name) * @version (a version number or a date) */ public class Students extends Person { private String classlevel; /** * Constructor for objects of class Students */ public Students() { } /** * An example of a method - replace this comment with your own * * @param y a sample parameter for a method * @return the sum of x and y */ }
Java Code:/** * Write a description of class Staff here. * * @author (your name) * @version (a version number or a date) */ public class Staff extends Person { // instance variables - replace the example below with your own private String office; private String title; /** * Constructor for objects of class Staff */ public Staff() { } /** * An example of a method - replace this comment with your own * * @param y a sample parameter for a method * @return the sum of x and y */ }
Java Code:/** * Write a description of class Faculty here. * * @author (your name) * @version (a version number or a date) */ public class Faculty extends Person { private String office; private boolean tenured; /** * Constructor for objects of class Faculty */ public Faculty() { } /** * An example of a method - replace this comment with your own * * @param y a sample parameter for a method * @return the sum of x and y */ }
Similar Threads
-
BlueJ project called Dog-unit1
By knightj in forum New To JavaReplies: 2Last Post: 09-09-2013, 06:43 PM -
BlueJ project need some help with
By Big-D in forum New To JavaReplies: 2Last Post: 03-14-2012, 03:10 PM -
Bluej Project to exe
By jds93 in forum New To JavaReplies: 3Last Post: 11-12-2011, 02:07 PM -
Error Compiling Project in BlueJ
By java1337 in forum New To JavaReplies: 9Last Post: 06-17-2011, 09:04 PM
Bookmarks