Results 1 to 9 of 9
  1. #1
    ilop12 is offline Member
    Join Date
    May 2010
    Posts
    10
    Rep Power
    0

    Default How to do a simple class+object thing

    Hey guys im really terrible at java and I never learned how to do this:
    Write a program to store and print the grades (3 classes, total, and average) of two students using class and objects.

    Could you guys give me some advice?

  2. #2
    iluxa is offline Senior Member
    Join Date
    Mar 2010
    Posts
    266
    Rep Power
    5

    Default

    start reading your textbook...

  3. #3
    ilop12 is offline Member
    Join Date
    May 2010
    Posts
    10
    Rep Power
    0

    Default

    ouch. no need to be so cold. want to be a little more specific?

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    Can you describe your app in more detail?
    Where do you want to store the output?
    Do you want to print to paper?

    How much do you know about classes and objects?

  5. #5
    ilop12 is offline Member
    Join Date
    May 2010
    Posts
    10
    Rep Power
    0

    Default

    well its for a stupid course i am forced to take and i just dont get anything because they dont use examples a lot. By print they just mean "System.out.println() nothing fancy. And to store i think they just mean if i define an int equal to 5 or a million. Just in the memory i think. I dont know a whole lot. I believe i am supposed to create a base class and then 2 sub classes i just dont understand how and what they really want me to do.

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    Do you have a text book for the course?

  7. #7
    ilop12 is offline Member
    Join Date
    May 2010
    Posts
    10
    Rep Power
    0

    Default

    its online and i read it many times it doesnt explain this well. I also researched it but nothing helped. I think its the phrasing of the question that is poor.

  8. #8
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    Before writing a program, you need to understand what it's supposed to do.

    If you were to use paper and pen, what are the steps you'd take to compute the grades (total, and average) for 2 students taking 3 classes?
    Break the steps down to as low a detail as possible.
    Until you can do that, you can't design and write a program.

  9. #9
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    Another aspect of this assignment is the OOP design part. I'm weak in that area. This assignment's specification could have given more help with the OOP design.

    My weak attempt:
    Create classes for things and methods for actions.
    The assignment has two things: Students and Courses.
    The problem I'm having is where to put the grade.
    From the Student point of view: A student has several properties such as name, age, .. and a list of courses he is taking. For each course there would be a grade.
    From the Course point of view: A course has properities such as instructor, when it meets, ... and a list of students taking the course. For each student there would be a grade.

    Where does the student's grade go? In the Student class or in the Course class?

    I'll wait for some OOP guru to come and design it.

    Good luck.

Similar Threads

  1. please i need help with a simple thing
    By zohdi in forum New To Java
    Replies: 28
    Last Post: 05-30-2010, 01:41 AM
  2. Replies: 3
    Last Post: 03-15-2010, 08:44 PM
  3. [SOLVED] Simple Trig Thing
    By AndrewM16921 in forum New To Java
    Replies: 4
    Last Post: 05-16-2009, 06:45 AM
  4. Replies: 5
    Last Post: 02-25-2009, 07:14 PM
  5. Creating object of Type Object class
    By venkatv in forum New To Java
    Replies: 3
    Last Post: 07-17-2007, 03:33 PM

Posting Permissions

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