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?
Printable View
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?
start reading your textbook...
ouch. no need to be so cold. want to be a little more specific?
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?
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.
Do you have a text book for the course?
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.
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.
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.