Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Java Homework2

I have a homework this is my second question. If u can help me.

Question 2
a) Define a class Student with the following members.
name, id, math_mark, eng_mark to hold the students name, id, math and
english exam marks These (private) members must not be directly accessible
outside the class.
A parameters-constructor to initialise the member variables of an instance
of Student.
get Methods to return the name, id and mark of a student.
A method Average( ) to calculate and return the average of the math and
english marks for the student.

b) Define a class TestStudent with a main method.
In the main method of TestStudent create an instance of student (using
the parameters constructor). The students name, id and marks should be input
by the user at runtime and then passed as parameters to the constructor.

Call the Average( ) method to calculate the average of the two marks.
Display the student name, id and average mark.

So if anybody can help me in solving my homework.
thanks alot.
[1091 byte] By [Mona] at [2007-11-9 22:27:44]
# 1 Re: Java Homework2
You'd probably learn a lot more if you actually tried to do it yourself. Why
are you bothering to take this course if you are not going to try to do the
problems? The things that you are asking are so basic that anyone who has
any interest or aspiration to actually learn Java must definitely learn the
concepts!

you're only cheating yourself.

"Mona" <mona941406@yahoo.com> wrote in message
news:3ac45db8$1@news.dev-archive.com...
>
> I have a homework this is my second question. If u can help me.
>
> Question 2
> a) Define a class Student with the following members.
> name, id, math_mark, eng_mark to hold the student's name, id, math and
> english exam marks These (private) members must not be directly accessible
> outside the class.
> A parameters-constructor to initialise the member variables of an
instance
> of Student.
> get Methods to return the name, id and mark of a student.
> A method Average( ) to calculate and return the average of the math and
> english marks for the student.
>
> b) Define a class TestStudent with a main method.
> In the main method of TestStudent create an instance of student (using
> the parameters constructor). The student's name, id and marks should be
input
> by the user at runtime and then passed as parameters to the constructor.
>
> Call the Average( ) method to calculate the average of the two marks.
> Display the student name, id and average mark.
>
>
>
>
> So if anybody can help me in solving my homework.
> thanks alot.
>
>
>
>
>
>
>
>
>
Mike at 2007-11-11 23:05:28 >
# 2 Re: Java Homework2
"Mona" <mona941406@yahoo.com> wrote:
>
>I have a homework this is my second question. If u can help me.
>
>Question 2
>a) Define a class Student with the following members.
> name, id, math_mark, eng_mark to hold the students name, id, math and
>english exam marks These (private) members must not be directly accessible
>outside the class.
> A parameters-constructor to initialise the member variables of an instance
>of Student.
> get Methods to return the name, id and mark of a student.
> A method Average( ) to calculate and return the average of the math and
>english marks for the student.
>
>b) Define a class TestStudent with a main method.
> In the main method of TestStudent create an instance of student (using
>the parameters constructor). The students name, id and marks should be
input
>by the user at runtime and then passed as parameters to the constructor.
>
> Call the Average( ) method to calculate the average of the two marks.

> Display the student name, id and average mark.
>
>
>
>
>So if anybody can help me in solving my homework.
>thanks alot.
>
>
I could help you, but than you wouldn't learn anything, and that's the goal
of the questions.
>

>
>
>
>
>
>
michiel at 2007-11-11 23:06:23 >