Help me with my test.I don't know how to start it !
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Help me with my test.I don't know how to start it !
Please post your code and questions here on the forum. No links.
If you don't understand my answer, don't ignore it, ask a question.
Student
#matricNo: String
#name: String
#course: String
+Student(matricNo: String,
name: String, course: String)
+Display( ):void
UnderGrad
‐CGPA: double
+ UnderGrad (matricNo: String,
name: String, course: String,
CGPA: double)
+Display( ):void
PostGrad
‐ResearchArea: String
+ PostGrad (matricNo: String,
name: String, course: String,
ResearchArea: String)
+Display( ):void
Supervisor
‐StaffID: String
‐SName: String
‐Dept: String
‐svStudent: Arraylist<String>
+ Supervisor (StaffID: String,
SName: String, Dept: String)
+setSvStudents(svStudent:
Arraylist<String>): void
+DispSvStud( ):void
Write a complete program based on the class diagram above. You are required to show
inheritance concept inside your program. Use the following information to produce the code:
‐ Use the constructor for each class to initialize class attributes and accepts parameters sent.
For the subclasses (UnderGrad & PostGrad), they will also initialize its superclass
attributes.
‐ Display() method:
‐ Student class: display all attributes.
‐ UnderGrad class: display all superclass attributes and CGPA.
‐ PostGrad class: display all superclass attributes and Research Area.
- For the Supervisor class, the constructor will be used to initialize the value for attributes
StaffID, SName and Dept. svStudent will store the list of students’ names that are
under the supervisor’s supervision. The value for the svStudent will be assigned using
setSvStudents() method. This method will receive an Arraylist of type String as
parameter. And then this ArrayList will be assigned to the ArrayList svStudent that has
been declared before.
- DispSvStud()method will display the supervisor name and all students under his/her
supervision (the content of the ArrayList).
‐ You are required to write the main() method to implement the classes that have been
defined.
Did you have any specific questions about your assignment?
What have you tried?
Post your code and your questions about the problems you are having.
If you don't understand my answer, don't ignore it, ask a question.