
July 23rd, 2009, 08:08 AM
|
 |
Sergeant
|
|
Join Date: Dec 2007
Location: WA, Australia
Posts: 228
Thanks: 18
Thanked 7 Times in 5 Posts
|
|
Re: O.T Help sought from Java Programmers
Quote:
Originally Posted by ano
There's no problem to write this, actually. If I have time in the evening, it will take about 15 mins. I'm just not sure that's what you want. Because it will give absolutely no knowledge and make you vulnerable to simplest questions.
|
Sorely tempted...  The thing i find with code is when you have an example to follow it makes sence. You can trace through it - work it out. I feel at present that i have gone from making simple procedural style programs to this, and i have got lost along the way.
Quote:
Originally Posted by Psycho
First, in the constructor you inverted your assignments - it should be studentID = sId, instead of sId = studentID, etc. Then, your fields should be private. You also need setters. And probably not everything should be a String, but that's less important.
In printDetails() you would use a StringBuilder class to combine all those Strings from fields into one String the method will return.
Enrollment would have one array of Student objects, addStudent() would add a new student to the array and return the index, getStudent() would use the index to retrieve the Student object, printEnrolment would iterate through the array and invoke printdetails on each student and write that to System.out. It would be useful to have a method to return the number of Students as well.
Admin would have the Main method in which he would call filData and then searchStudent in a loop until he gets a result. fillData creates an Enrollment object, then Student object whose data are hardcoded and inputs them into the enrollment using addStudent, then finally printsEnrollment. searchStudent takes a year, then calls getStudent for each Student, takes his year and if it matches prints his data to System.out; it returns true if successful, otherwise false.
Anyway, that's how I understood what you are expected to do. I know it's a total beginner level project, but I think it's very poorly composed.
|
Looking at this i get some tingling in the back of my head. Its like understanding wants to burst through damn it! This is helpful though almost makes sence! 
|