Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A little stumped on how to approach next step of my program!

 
Price Peddicord
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay i am making a program for my java1 class and it has to be something that we could use for ourselves, so im making a grade predictor program, basically it asks for how many assignments, then how many points each is worth, then how many we have completed and points on those etc. Basically what i want it to do after that is this


i want it to then output saying what i need on the final grade and or grades at a minimum for each letter grade! For example lets say i had 4 total grades, each worth 25 points a piece and i got perfect on the first 2 and have 2 left! I want it to output saying for an A i need 20 on Assignment 3 and 20 on Assignment 4 For a B i need 15 on each then for a C 10 on each and D 5 on each, however i need to have stuff in there that spreads the points out like such and doesn't say 25 on one and 15 on one i want it spread as evenly as it can be, also if i had one assignment worth 5 and another worth 20 i dont want it to be like i need 10 and 10 when 5 is the max!

Im a little stumped on how to approach this step, wondering if anyone could give me a few pointers or a starting point of where you might start out with this! And my code so far is below!

Thanks im new here but ive been around forums, just starting the java forums however!

 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First do it on paper. You know the total points (t), you know your points earned(p), you know your exams remaining(r), write down the formula that will compute the remaining points and then compute the points per exam for the remaining exams. You will have to worry about rounding errors, but go step by step for now
 
Price Peddicord
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jayesh A Lalwani wrote:First do it on paper. You know the total points (t), you know your points earned(p), you know your exams remaining(r), write down the formula that will compute the remaining points and then compute the points per exam for the remaining exams. You will have to worry about rounding errors, but go step by step for now



Well using T P and R the first formula would be

T - P = remaining points possible(rp)

R = numberOfGrades - completed

and to find current grade with 0s it would be current average = p/t

to divide the points up i suppose one forumla could be rp/R

but im not sure what formula or how i would call out the specific array sections?
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rp/r is Almost exactly what you need. Aside from rounding errors, you have your answer.

Take some examples and run them through your formula.
 
Price Peddicord
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jayesh A Lalwani wrote:Rp/r is Almost exactly what you need. Aside from rounding errors, you have your answer.

Take some examples and run them through your formula.


okay im working on putting those in,,, one problem im having is im not sure how to set it up for an A now obviously an A is gonna be 90% when you divide the points earned by the points possible but how can i make it where it will output the minimum points needed for that A?
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For A grade, use 90% of T instead of T in your formula. Everything else remains the same
 
Price Peddicord
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jayesh A Lalwani wrote:For A grade, use 90% of T instead of T in your formula. Everything else remains the same


Im sorry that confused me lol after looking and looking at this stuff i feel like the way to do it would be to make a loop that kept adding to a int until it hit the maximum of the first assighment and have it somehow store that then start adding to the next assignment etc while it does not = 90%


im just having ah ard time figuring out how to write out the stuff inside the do while loop :/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic