Jerry Carpenter

Greenhorn
+ Follow
since Nov 03, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jerry Carpenter

Great after much headaches for me and probably you guys. I have finally got it all working. I appreciate all the advice, it really helped. This program relied heavily on objects which I was not that familiar with. But after over looking how this thing really works; I am really beginning to understand it.
thanks fellas.
15 years ago
How exactly would I go about giving a class references to the other.
code:
[edit]Disable smilies. CR[/edit]
[ November 11, 2008: Message edited by: Campbell Ritchie ]
15 years ago
well my code above shows the layout of the program. and it does return a value
and it is an object.
15 years ago
Well it reads the courseId from the student and sends it to the findCourse method which iterates through the courses and if it finds a match it returns the course. Now evidently I am supposed to make a link between the two and thats where I am just flat out lost.
15 years ago
Well I still dont understand what is meant by adding the student to the course "<link course to student>;". And how I would be able to represent that in a gui interface. Im sure you fella's are getting tired of my questions by now LOL
15 years ago
so would I say course.equal(courseId)
15 years ago
I did a little more and I created another arraylist named sc

is this the general idea or not?
15 years ago
Im still not sure what is meant by placing the student in the list of the course. How would I do that.
Here is what I got for that code


then if it does indeed match I would place that student with the course. I just dont understand how to make it happen. I dont even know if this code is how you get it done. Also, how is this going to work in the gui.
15 years ago
Im not sure how to create the link, and how it would work. This will work in a gui interface right?
15 years ago
Ok cool now this part gave me an error (course.id.equals(id)) so I changed it to (course.courseCode.equals(id)) should i have left that alone. Also, can I store the ArrayList students in a JList and the ArrayList courses in a JList as well.
15 years ago
Well all I need it to do is when I click on a student it show his courses. And when clicking on a course it show the students in that specific course. So, I dont need it to add or drop courses. Can this be done with the way its set up. Obviously, Im going to have two separate JList's.
15 years ago
Here is my new code put together; I dont know if its right or not.

Now the linking process needs to be for both as in, I click on student and it shows their courses; clicking on the course will show the students in the course. So, my question is do I still only have to do the link only once in the student section?
15 years ago
Im sorry I keep bothering you on this.
But where are you telling me to put this code


and then this code:

Also I see you have references of students and courses. Should those be ArrayList as well to student and course
15 years ago
wait i think i see what you mean.
ArrayList<Student> students = new ArrayList<Student>();
ArrayList<Course> courses = new ArrayList<Course>();
correct?
15 years ago
so no ArrayList for the student? just for the course? also I see no creation of a Course class do I need one?
15 years ago