winnie Lim

Greenhorn
+ Follow
since Feb 10, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by winnie Lim

Thanks a million. And i mean it
16 years ago

I'm getting <identifier expected> at line 1 and 2. But i hardly see anything problem with it. I seriously don't have time for any more "trying on your own" or refering to tutorials and believe me, this is my 4th sleepless night. Its due in 4 hours can any kind soul please please help me out here. Seriously need some help thanks alot alot alot.
16 years ago
thanks! will read through and try to understand on my own.

you guys have been a great help thanks a million!!!
16 years ago
hey thanks!

but after i declare eg School sch = new School ();

what do i do to invoke the methods in the object?
16 years ago

Campbell Ritchie wrote:How do you create a new object of any class? You do the same with the School class.
And please don't go saying questions are urgent.



erm... i really don't know how to create a new object of anything! i already tried looking through all the online tutorials but i really can't get what they mean or what how the object class in created. Please if you can, just help me out here.
16 years ago

Campbell Ritchie wrote:You appear to be calling addStudent() etc from another class, SchoolApp, and SchoolApp hasn't got an addStudent() method.

You need to create a School object in that main method, then invoke the methods on that object.

By the way: your addStudent method in the School class doesn't seem to do anything. It asks for the Student's name, but doesn't do anything with it. It that because the class is incomplete?



yes the code is incomplete... i'm supposed to store it into a arraylist and retrieve it.

sorry to ask but can you teach me how to create a School object in the main method? I know it sounds stupid but i really am new and its a pressing assignment.
16 years ago
is there anything wrong with my School class?

i can't seem to call the addStudent, removeStudent, methods in my public class SchoolApp. i get error "cannot find symbol method addStudent();"

thanks alot for the java.lang.NoSuchMethodError! solved!

16 years ago


i keep getting java.lang.NoSuchMethodError: main
Exception in thread "main" when i try to run it but it complies fine. Can anyone advise? Thanks!

Also i would like to ask how would i save the student name and ID into an arraylist and retrieve it from the arraylist to delete? Thanks for help!
16 years ago
yeah unfortunately this is a first java program for me....

So the method headings are correct? May i ask what are constructors and how to declare one?

thanks for your advice.
16 years ago
hi there i have some questions regarding declaration of methods in a class. I've started a little but ain't sure if i'm on the right track or not. Also i'm not sure what goes into the methods or how to declare. Anyone can point me in the right direction ? Thanks alot!

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

What i have done so far is



16 years ago


you were a great help

now i gotta slog through my assignment, hopefully will be able to scrape through. I have a lousy lecturer who speaks Martian
16 years ago
thanks! works like a charm! after lots of fiddling though
16 years ago

Campbell Ritchie wrote:So, what have you set your PATH to? And why did you set a CLASSPATH at all? Why are you keeping all your Java work on your desktop?



i don't get you? What do you mean by setting PATH? and classpath?

sorry for the questions cause this is really my 1st java program i'm testing out
16 years ago
Hi!

I am a new student in Java Programming and have been instructed to use JCreatorLE for my programming. However when i tried to do my assignment codes and saved it and ran it, it could compile fine but when it ran, it gave me an error of:

GE2001 Version 1.4
Error : Invalid Path, /bin/java.exe - classpath C:/Desktop/MainMenu

Press any key to continue - and it terminates the program.

When i saved my test program i used the file name MainMenu.java and the codes are below:

import java.util.Scanner;
public class MainMenu
{
public static void main (String[]args)


{


Scanner scan = newScanner (System.in);
System.out.print ("The Module Registration System Main Menu");

}
}

Plese advise me on what went wrong with my JCreatorLE as i have a deadline to rush which is rather pressing.

Thanks a million!
16 years ago
oops! let me sort out my code and i shall post it here!

Cheers everyone and good night!
16 years ago