Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Java Object Oriented Grades Program  RSS feed

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Begin with putting lines 23 and 24 inside a method (calculate() for example)
 
Bartender
Posts: 2633
17
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
New? java is case sensitive Ben.
Try with



 
Ben Peer
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried that and it didn't help any still got error messages
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure it does.
Look at your constructor. Where is it?
 
Ben Peer
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the

and the GradesTester class

should i move it out of

 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


this is what i get with the constructor thing in the Grades class instead of the Gradestester class
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry for keeping you up im just starting from scratch
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Marshal
Posts: 59742
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brandon Armstrong,
Your post was moved to a new topic.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!