Results 1 to 13 of 13
  1. #1
    Nuller is offline Member
    Join Date
    Sep 2014
    Posts
    7
    Rep Power
    0

    Unhappy Can anyone help me on some questions on JAVA?

    I have an assignment due in 2 days and lecturer hasn't thought much. so i know how to use object oriented concepts in java. Creating classes relating them from one to another. but have a question, Well in a nutshell the question is i have to create a GUI app using the 3 classes Student, Batch and Marks. (Under student class, attributes are given such as student name, student ID, institute id.. etc) and Batch class (Attributes are given such as batch code, batch representative id and Student institute Id's) So for this do i have to create a student array in the batch class or something? can someone help me on that??

    And one more question, in the Marks class (attributes are given such as subject Name, Subject Code, lecture Name, Marks of individuals for a selected batch How do i get the marks of individuals for a selected batch?? and how do i enter the marks in the test class?

    have to insert GUI too for this no idea what so ever. but atleast some help for the above would be appreciated ALOT!

    Some help would be much appreciated because i'm getting sick of trying this and even sick of this programming :( please help!

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Can anyone help me on some questions on JAVA?

    What have you tried?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    Nuller is offline Member
    Join Date
    Sep 2014
    Posts
    7
    Rep Power
    0

    Default Re: Can anyone help me on some questions on JAVA?

    Quote Originally Posted by Norm View Post
    What have you tried?
    the questions i've asked on this thread

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Can anyone help me on some questions on JAVA?

    You need to post some code showing what you have tried.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    Nuller is offline Member
    Join Date
    Sep 2014
    Posts
    7
    Rep Power
    0

    Default Re: Can anyone help me on some questions on JAVA?

    //ive made a class called Student and it has the attributes i mentioned above such as student name, student ID, student Institute ID,
    and i have to have a method in the batch class (2nd class) which displays all the student institute id's so i tried the following code saying std is the name of my Student ArrayList,
    but i have no idea how to get the student institue Id's. which is an attribute in the Student class

    public boolean addStudent (Student newStudent) {
    std.add(newStudent);
    num++;
    return true;

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Can anyone help me on some questions on JAVA?

    how to get the student institue Id's.
    Add a getter method to the class that returns the id.

    Why does the posted method always return true? Why return any value if the value returned is always the same?

    When posting code please wrap your code with code tags:
    [code=java]
    YOUR CODE GOES HERE
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    Nuller is offline Member
    Join Date
    Sep 2014
    Posts
    7
    Rep Power
    0

    Default Re: Can anyone help me on some questions on JAVA?

    thanks alot for that i will put a getter. but once i put a getter in the "Student" class i can just call it in the "batch" class and connect it to an arraylist?

    And i'm new to this forum sorry about that, if not boolean what should i return there? or should i just use void?

    And one more thing three main classes are given right Student, Batch and Marks. so in the Marks class i must create a method that returns all the marks of the students.. (that is like next to the IDno) how can i do that?

  8. #8
    Nuller is offline Member
    Join Date
    Sep 2014
    Posts
    7
    Rep Power
    0

    Default Re: Can anyone help me on some questions on JAVA?

    in the Marks class i must create a method that returns all the marks of the students.
    Last edited by Nuller; 09-21-2014 at 04:06 PM.

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Can anyone help me on some questions on JAVA?

    should i just use void?
    Yes.
    put a getter in the "Student" class i can just call it in the "batch" class
    Yes, any class that has a reference to a Student class object will be able to call the Student class's getter method.

    connect it to an arraylist?
    Sorry, I don't know what that means.

    in the Marks class i must create a method that returns all the marks of the students.
    That should be defined in the assignment.
    What is the Marks class for? What data does it hold? Who calls its methods?
    If you don't understand my response, don't ignore it, ask a question.

  10. #10
    Nuller is offline Member
    Join Date
    Sep 2014
    Posts
    7
    Rep Power
    0

    Default Re: Can anyone help me on some questions on JAVA?

    Thank you very much sir for all this. can i message you cause i have alot of questions more?

  11. #11
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Can anyone help me on some questions on JAVA?

    Please post your questions here.
    If you don't understand my response, don't ignore it, ask a question.

  12. #12
    Nuller is offline Member
    Join Date
    Sep 2014
    Posts
    7
    Rep Power
    0

    Default Re: Can anyone help me on some questions on JAVA?

    haven't said anything about the data it holds or who calls the method.
    Last edited by Nuller; 09-21-2014 at 06:10 PM.

  13. #13
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Can anyone help me on some questions on JAVA?

    If you don't know why any methods are called or what data is available, it will be hard to write code to use them.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. New to java and have a few questions
    By schizomike in forum New To Java
    Replies: 2
    Last Post: 09-26-2012, 08:17 AM
  2. Questions about java JVM
    By davetheant in forum New To Java
    Replies: 12
    Last Post: 02-15-2011, 12:31 AM
  3. Replies: 23
    Last Post: 12-21-2009, 11:28 AM
  4. Pls i need help with these 2 Java Questions
    By jyde in forum Advanced Java
    Replies: 2
    Last Post: 10-19-2008, 07:33 PM
  5. Java Questions...
    By Xarver in forum New To Java
    Replies: 11
    Last Post: 09-20-2008, 05:37 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •