Member Avatar

Hello I need help and fast, time is running me out.

StudentMark class
A StudentMark object hasd three attributes:moduleNo(a string),studentName(a string) and mark an (int). There is a constructor which registers a student (studentName) with a module number (moduleNo) at the time of construction. There are methods that enable new marks to be entered and retrieved. All the methods of this class are listed below:


A constructor. It accepts two strings and assigns them to the moduleNo and studentName respectively. It also sets the mark of the student to 0.

Two string objects

There are other methods but I thing I can do them.

Please help, I dont no wat a constructer is and my teacher she really sux. What is a method? Is it like a function or sumthing. And is my studentMark class the name of my program or an actual class like in c/c++.

God bless. :cry:

Here is wat i have so far.

Recommended Answers

All 6 Replies

Do your own homework kid.

If you don't know what a constructor is, read some tutorials or maybe it's time to open those course instructions for a change and maybe pay attention in class instead of browsing nekkid women on the web.

Member Avatar

I wish there was someone who would help me instead of mocking me...

Those kind of remarks are just childish jwenting.

Member Avatar

Can sum1 give me sum sudo code for the constructor part.

I think i have 2 use objects as well which is really confusing me. I don't like this, student.moduleno sintax.

BTW is a method the same as a function like in C?

God bless

If you'd tried noone's mock you, but as it is you're just a whining little kid asking to get his homework done for him.
That's not just stupid, it's against the rules for this forum.

Member Avatar

Ok let me read up on this, then i'll post wat i got.

The only thing is i really confused. It's the jargon which confuses me because in java, a class can be an actual program, and a method is like a function in C i think.

It's hard for me to switch from one language to another.

In Java everything (except primitives) is a class.
A Java program is a collection of classes, one of which has a main method (or rather an entry point for a JVM, which is usually a main method).
Of course for many small programs (especially the kind you're likely writing as a student) there will be only one class.

Each class will have a constructor (even if you don't write one, in which case one will be provided by the compiler), which replaces the typical method provided with many C structs to initialise them.

You're really going to have to get to grips with OO principles. It's a rough road but a worthwhile one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.