File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Java Object Oriented Grades Program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Object Oriented Grades Program" Watch "Java Object Oriented Grades Program" New topic
Author

Java Object Oriented Grades Program

Ben Peer
Greenhorn

Joined: Apr 21, 2010
Posts: 15
Basically this is it, Friday I have this program due. I've been trying but cannot figure it out so I'm seeking help.

This is what the assignment is:

Write a OOP program for your Computer Science teacher that can be used to calculate final grades in Computer Science. The teacher uses the following grade items:
1. five quizzes, each graded out of 10 points
2. a midterm exam graded out of 100 points
3. a final exam, graded out of 100 points

The defining class should contain a constructor with parameters for student’s name, test marks, midterm mark and final exam.

The defining class will have one method to calculate a student’s numeric grade and their final letter grade. Grade items will be weighted as follows:

1. final exam counts for 25% of the final mark
2. midterm counts for 25%
3. five quizzes together count for a total of 50%.

The final letter grade will be determined as follows:

1. 90 or more is an A
2. 80 or more(but less than 90) is a B
3. 70 or more(but less than 80) is a C
4. 60 or more(but less than 70) is a D
5. below 60 is an F

The method should output both the calculated, numeric grade and the final letter grade.

Write a tester class to test your application. Use the constructor to create five students and initialize the instance variables for each student. Invoke the method to calculate the numeric grade and final letter grade for each student. Output each student’s name and show their numeric grade and letter grade.


This Is What I've Done




I keep getting error messages and I just really need help to get it to compile properly then i can at least start getting the bugs out. any help is appreciated.

Thanks if you can help.
Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
Begin with putting lines 23 and 24 inside a method (calculate() for example)

Bye,
Nicola
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

Welcome to JavaRanch, Ben.
Ben Peer wrote:...I keep getting error messages and I just really need help to get it to compile properly then i can at least start getting the bugs out. ....
What are these error messages?
Ben Peer
Greenhorn

Joined: Apr 21, 2010
Posts: 15
at my constructor



Error : ';' expected Grades student1 = New Grades("Marcus Banks", 78, 86, 87); ^



it says with the ^ under the G in Grades that ';' is expected (for all of them student1 to student5)


also i dont know how to reply on these :S ??
Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
New? java is case sensitive Ben.
Try with



Ben Peer
Greenhorn

Joined: Apr 21, 2010
Posts: 15
I've tried that and it didn't help any still got error messages
Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
Sure it does.
Look at your constructor. Where is it?
Ben Peer
Greenhorn

Joined: Apr 21, 2010
Posts: 15
in the

and the GradesTester class

should i move it out of

Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
You wrote



but in class Grades where's the constructor that takes 4 arguments (String,int,int,int) ?

write it in class Grades, let me know
Ben Peer
Greenhorn

Joined: Apr 21, 2010
Posts: 15


this is what i get with the constructor thing in the Grades class instead of the Gradestester class
Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
The lines


has to stay where they were. You can place them back where you cut them.

You should write in class Grades the corresponding constructor, because Grades does not know what a call to
Grades("Marcus",78,86,87) is

in class Grades then write the constructor.

In Italy now is 0:30 and tomorrow i need to wake up early...but you will surely find other people ready to help you. If you don't i will tomorrow.

The last thing. Look at your code. You don't need Basketballs now...you are doing your homework. You need just Grades.



Ben Peer
Greenhorn

Joined: Apr 21, 2010
Posts: 15
sorry for keeping you up im just starting from scratch
Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
It's ok, don't worry. I was just telling you that you wouldn't have found me online for some hours

Well, how's your code? Did you solve your problems?

If not, can you please post it again with the changes you made?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38003
    
  22
Brandon Armstrong,
Your post was moved to a new topic.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Object Oriented Grades Program
 
Similar Threads
Grading Program--Need help, please!!!
Grading Program..... (part 2)
Averaging Grades Assignment
Grading Program..... (part 2)
Grading Program.....Need help !! Please...