• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need Help Creating Classes  RSS feed

 
Chris Hathaway
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont really get how I am supposed to be doing this, my teacher mentioned writing two different programs at the same time.

Was wondering if you all could throw out some pointers, or maybe some basic tips that would get me in the right direction.
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris Hathaway,

Please TellTheDetails. What do you mean by 'writing two programs'? Is it something like a program containing two classes etc.? What do they do?

Also, why to do this at 'the same time'? I really didn't get this. I write one class at a time
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pointer: Explain your question a bit better. What classes do you need to create? What's the assignment?

I agree that "writing two different programs at the same time" could be confusing, but I suspect you may have misinterpreted something your teacher said. Please give us the context.
 
Chris Hathaway
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
agreed i apologize!

Basically im supposed to be creating a class to model a student, and a couple of test grades,

this is what she put on the description for the project
Part I:
Write a program Student.java to model a college student and test each method in StudentTest.java.

Part II:
Add studentID to Student.java to describe a college student id number, a unique number.
Therefore, each student is created with a name, an id, 0 for both test one and test two.
A studentID should be read-only, it must be generated in the constructor.
A method getStudentID() should be provided to allow an access to a student id.

Let me know if I wasnt clear enough, or if you want any specific details or such.

 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So Part I is to write the Student class with a couple of instance variables for test grades (testOne and testTwo?) with the setters and getters necessary to access and mutate the instance variables. This part of what you've told us is a bit vague. I wonder if the Student class should include a name and maybe other personal details and a list of classes, but that's not clear. You may have some idea. Keep it as simple as the assignment allows. Student class should also have a constructor.

Part I has 2 parts. The second part is to write another class, StudentTest, that tests each method in the Student class. This would involve making an instance of Student and then using it to test Student's methods, showing the results.

To get started, write the Student and StudentTest classes. Come back when you need help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!