Okay so im working on a program for my Java1 class and its something we get to make that we can use personally, so im making one that will tell me grades, basically ive got the first parts as far as inputting stuff goes done, now 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! Below is my code as of yet, im not really sure how to approach this and was looking for some help, im new to java forums but ive been around plenty of forums!
Thank you for any pointers and help!
Thank you for any pointers and help!
import java.util.Scanner; public class Prog5 { public static void main(String args[]) { int numberOfGrades; int grade = 0; int gradesDone = 0; int completed; int totalPoints = 0; int points; int pointsEarned = 0; Scanner input = new Scanner( System.in ); System.out.println("How many total grades will there be? "); numberOfGrades = input.nextInt(); int [] grades = new int [numberOfGrades+1]; do { grade++; System.out.println("Points possible for assignment " + grade + ":"); grades[grade] = input.nextInt(); }while (grade < numberOfGrades); for ( int counter=1; counter < grades.length; counter++ ) totalPoints += grades[counter]; System.out.println("an ID "+ java.util.Arrays.toString(grades)); System.out.println(totalPoints); System.out.println("How many assignments completed?"); completed = input.nextInt(); int [] completedArray = new int [completed+1]; do { gradesDone++; System.out.println("Points recieved on assignment " + gradesDone + ":"); completedArray[gradesDone] = input.nextInt(); }while (gradesDone < completed); for ( int counter=1; counter < completedArray.length; counter++ ) pointsEarned += completedArray[counter]; System.out.println(totalPoints); System.out.println(pointsEarned); } }