1,105,340 Community Members

I need some Assistance in doing this....

Member Avatar
<M/>
Industrious Poster
4,473 posts since Apr 2012
Reputation Points: 106 [?]
Q&As Helped to Solve: 139 [?]
Skill Endorsements: 114 [?]
Featured
 
1
 

I have a project and I don't understand what the instructions want me to do. Can someone explain them better...? I don't understand constructors, objects, and methods very well but I am trying my best to do this project (i am a bit amazed how i got the highest grade on the test (33/35))...

Add a service  class to the project named Student.  This program will encapsulate the concept of  a student, assuming a  student has the following attributes (instance variables): a name, a social security number and a GPA (e.g.,  3.5).  For the Student class you will write the constructors, accessors and mutators, and toString and equals  methods.  In the client application class you will instantiate student class objects and write statements  (method calls)  to test the methods in your student service class

All i need is for someone to help me with re-reading the instructions in a different way... I should be able to do the rest by myself. I am trying to get a hold of my instructor to send me better instructions but he hasn't responded for a couple of days (this is his new instructions (above)) so i am getting new instructions, if he gives it...

Thanks guys.

Member Avatar
rubberman
Senior Poster
3,999 posts since Mar 2010
Reputation Points: 513 [?]
Q&As Helped to Solve: 501 [?]
Skill Endorsements: 87 [?]
 
2
 

There are any number of books and online articles that will help you understand object-oriented programming and methods. Anyway, which of these concepts don't you understand, and what do you think you know about them?

Member Avatar
IIM
Master Poster
742 posts since Jun 2011
Reputation Points: 163 [?]
Q&As Helped to Solve: 169 [?]
Skill Endorsements: 24 [?]
 
2
 

Now accrding to your instructor,there will be a class Student with constructors that can set value of instance variables.

Now you have to make your instance variables private so that it is not accessible directly oustside the class.Create accessors and mutators to access instance variables. (The role of accessors and mutators are to return and set the values of an object's state.An accessor method is used to return the value of a private field.A mutator method is used to set a value of a private field.).Override toString and equals method and perform some action.

Member Avatar
<M/>
Industrious Poster
4,473 posts since Apr 2012
Reputation Points: 106 [?]
Q&As Helped to Solve: 139 [?]
Skill Endorsements: 114 [?]
Featured
 
0
 

There are any number of books and online articles that will help you understand object-oriented programming and methods. Anyway, which of these concepts don't you understand, and what do you think you know about them?

I understand what they are (the basics) but the problem is that i can't apply my thinking towards some of the concepts, i overthink them. So far, i have been really been messing up with methods/constructors/objects.

@IIM, i am going to play around with that for a little bit, i am going to see how well i can follow your instructions (they sound easier at least/luckily).

Member Avatar
somjit{}
Posting Pro
540 posts since Sep 2010
Reputation Points: 28 [?]
Q&As Helped to Solve: 28 [?]
Skill Endorsements: 8 [?]
Featured
 
2
 

what i felt from the instructions :

  1. create a student class
  2. write the private instance variables
  3. overload the default constructor with social security number and GPA arguments
  4. write the public getters/setters etc , and also , override toString() and equals()
  5. then write a main method ( this is your test client )
  6. create new instances of students inside main, passing in social security number , GPA etc feilds in the constructor itself
  7. print them out in any manner you like.
Member Avatar
rubberman
Senior Poster
3,999 posts since Mar 2010
Reputation Points: 513 [?]
Q&As Helped to Solve: 501 [?]
Skill Endorsements: 87 [?]
 
0
 

So, all great suggestions (even my own...). :-)

In any case, start by decomposing your 1 point statement:

  1. Add a service class to the project named Student. This program will encapsulate the concept of a student, assuming a student has the following attributes (instance variables): a name, a social security number and a GPA (e.g., 3.5). For the Student class you will write the constructors, accessors and mutators, and toString and equals methods. In the client application class you will instantiate student class objects and write statements (method calls) to test the methods in your student service class

To this:

  1. Add a service class to the project named Student.
  2. This program (class) will encapsulate the concept of a student, assuming a student has the following attributes (instance variables): a name, a social security number and a GPA (e.g., 3.5). IE, member variables of name, ssn, gpa, etc.
  3. Implement the methods specified (constructors, assignment methods, getter methods, toString method, etc).
  4. Create an application (he calls this a class, but that can be optional) that creates objects of the Student class with appropriate data, and then manipulates that data, and finally outputs that data (toString) to validate that the actions you took are correct.

My most common bit of advice to my junior colleages is always to "simplify, simplify, simplify"... :-)

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article