aspose file tools*
The moose likes Beginning Java and the fly likes help in assignment please! =) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "help in assignment please! =)" Watch "help in assignment please! =)" New topic
Author

help in assignment please! =)

winnie Lim
Greenhorn

Joined: Feb 10, 2009
Posts: 16
In this assignment, you are to develop a java application that implements a university module registration system.

The module registration system allows the university administration staff to add and remove modules from the curriculum, register new student , remove student and register module to be taken by a student.

The system also provides the following display functions for administrator:
1. Display all the information for each module in the module list
2. Display the complete list of students
3. Display a list of modules currently taken by a particular student

The application:

A user in the Module Registration System is first presented with a main menu, the
“Module Registration System Main Menu”.
Two options will be presented, the “Module Matters” option and the “Student Matters”
option. The “Module Matters” submenu will contain options pertaining to the administrative details of modules, whereas the “Student Matters” submenu will contain options pertaining to the administrative details of students.

Student Registration System
1. Add a student
2. Remove a student
3. Add a module
4. Remove a module
5. Display module list
6. Display student list
7. Register module(s) for a student
8. Display module(s) taken by a student
9. Quit

To implement such a system, your Java program should consist of the following
supporting classes.
1. The Module class represents a module. A module
has a moduleID (int), a moduleName (String), a population (int) property indicating
the number of students currently taking it, and the classLimit (int), which is the
maximum population size that can take the module, and a semester (int) property
that indicates when the module is offered (either semester 1 or 2). The Module
class has a constructor that takes in moduleID, moduleName, classLimit and
semester.
It has the following methods:
/*Returns true when classLimit has been reached, not allowed to register a
student for this module when class size is full */
public boolean isFull()
/*Returns true when the module is offered in the semester sem */
public boolean isOfferedInSem(int sem)
The toString method returns a String that contains all the property values in the
form of
<moduleID><moduleName><semester>> <Number of students taking it> <class limit>
eg
101 Programming Fundamentals 1 100 130
202 Intermediate Programming 2 80 100
303 Advanced Programming 2 50 50

2. The Student class represents a student. A student has a studentID (int), a name
(String),and a list of modules currently taking (ArrayList of Modules)
It has a constructor that accepts studentID, and name.

3. The School
class represents the Module Registration System in a school. It has three properties:
the schoolName (String), and two collection lists, namely moduleList(ArrayList of
modules) and studentList( ArrayList of students.
The class has the following methods:
􀁸 addStudent – This method accepts a Student object and adds it to the
studentList.
􀁸 addModule – This method accepts a Module object and adds it to the
moduleList collection.
􀁸 removeStudent - This method accepts a int representing the studentID and
searches for the student within the studentList collection. It returns true when
the student is found, and removed from the studentList. Otherwise it returns
false.
􀁸 removeModule - This method accepts a int representing the moduleID and
searches for the module within the moduleList collection. It returns true when
the module is found, and removed from the moduleList. Otherwise it returns
false.
􀁸 searchStudent – This method accepts an int representing the studentID and
searches for the student within the collection of students. It returns the student
if found, otherwise it returns a null value.
􀁸 searchModule – This method accepts an int representing the moduleID and
searches for the module within the collection of modules. It returns the module
if found, otherwise it returns a null value.
􀁸 listModules – This method goes through the collection of the modules and
displays all the information of each module in the moduleList.
􀁸 listStudents – This method goes through the collection of the students and
displays all the information of each student in the studentList.
􀁸 classFull - accepts a moduleID (int) and checks if the classLimit for the
module has been reached.
􀁸 isOfferedInSem - accepts a moduleID (int) and a sem (int). It checks if the
module is offered in the semester sem.
􀁸 registerModule – This method accepts a studentID (int), a moduleID (int) and
a semester (int). Returns true when the module is added to the module list in
the Student object. Otherwise it returns false.

􀁸 ListModulesTaken – This method accepts a studentID (int) and display a list
of modules taken by the student in the format shown below.
005 Tan Ah Teck
101 Programming Fundamentals
202 Intermediate Programming

4. The SchoolApp class is the driver class, It should create an instance of the School
class with Bogus School as the school name, followed by displaying the main menu
option. Based on this option, a relevant submenu is then displayed. The choice made
on the submenus will determine the nature of task. This task is performed using
appropriate methods of the School, Module and Student classes. To perform the
task selected, the driver class should include the following functionalities:
􀁸 Add a student
Prompts user for the relevant input to create a new student object, It should check if
there is any duplicate before the student is created, If there is no duplicate, the new
student object is created and added into studentList within the School class using the
addStudent method.
The option should display either
“Duplicate student ID” if the student ID already exists, or
“Added 002 Tan Ah Teck successfully” if the add is successful.” 002 is the
studentID, whereas Tan Ah Teck is the student name.
􀁸 Remove a student
Prompts the user for a student ID. For simplicity no check is required to remove the
student. The option should display either
“Non-existing <studentID> – removed failed”, or
“Removed <studentID> successfully”

􀁸 Add a module
Prompts the user for the relevant input to create a Module object. It should check if
there is any duplicate before the object is created. If there is no duplicate, the
Module object is created and added into the collection of the ModuleList (ArrayList)
within the School class using the addModule method.
The option should display either
“Duplicate module ID” if the module ID already exists, or
“Added 101 Programming Fundamentals successfully” if the add is successful.”.
This option keeps prompting about semester when the semester input is invalid.
􀁸 Remove a module
Prompts the user for a moduleID. Allows the user to remove the module only when
no students are currently taking the module,
The option should display either
“Non-existing <moduleID> – removed failed”, or
“There are still students taking the module – removed failed”, or
“Removed <moduleID> successfully”
􀁸 Display module list
It searches through the collection of modules and displays all information about the
module.
This option should display either
“Module list is empty” if there is no module listed yet, or in the format
<ModuleID> <moduleName><semester><population><classLimit> , eg
101 Programming Fundamentals 1 100 130
202 Intermediate Programming 2 80 100
303 Advanced Programming 2 50 50
􀁸 Display student list
Go through the studentList and displays the studentID and name for each student.
This option should display either
“Student list is empty” if there is no student listed yet, or in the format
<studentID><studentName>, eg:
001 Tan Daisy
002 Tan Ah Teck
􀁸 Display modules taken by a particular student
This method accepts a studentID (int) and display a list of modules taken by the
student in the format shown below.
001
123 Module1 Name
234 Module2 Name
Where 001 is the studentID, 123 and 234 are the module ids,Module1 Name and
Module2 Name are the respective module names
􀁸 Register Module for a student
This option allows administrator to register student to take a particular module. The
user specifies the studentID, moduleID and semester. It checks whether the
module has currently being registered . On top of this, it verifies that the class limit
for that module has not been reached and the module is offered in the semester.
Given all the verification is successful, the module is added to the collection of
modules in Student class. A successful registration will produce a format similar to
the following output
“Student 002 registered for module 202 in semester 1 successfully“
If the studentID or moduleID is not found, the following output is produced:
“Registration failed – invalid studentID or moduleID”
Lastly, if the registration is unsuccessful as the module is not offered in this
semester, it produces the output
“Registration failed as module is not offered in semester <semester>”
<semester> is the integer input keyed in by the user earlier.
For successful registration, remember to increment the population property of
Module object.

ANY HELP WILL BE MUCH APPRECIATED! CHEERS!
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

So what have you done and where are you stuck?
This isn't a homework service but if you give us specific questions we certainly help you clear hurdles that get in your way. Just be sure that you show effort, and provide details about what you did, what you want, and what isn't working.


Steve
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

1) Please read your private messages regarding an important announcement.

2) Please Do Your Own Homework. Now I know you haven't asked us for a complete answer, but this does lead to

3) Please Show Some Effort. We have no problems with helping you, but we're not going to do it all for you. What have you done so far?


Overall, with you being new and all, I think it wouldn't hurt you to read How To Ask Questions On JavaRanch.


Thank you,

Rob


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
winnie Lim
Greenhorn

Joined: Feb 10, 2009
Posts: 16
oops! let me sort out my code and i shall post it here!

Cheers everyone and good night!
 
 
subject: help in assignment please! =)