Okay im creating a program for my beginning programming class, and its one we get to make for personal use as well, so mine is a grade program!
In the loops i cant figure out how i can make it keep adding the stuff for example i run the program say there are 2 assignments first is worth 20 points second is worth 50 i cant figure out how to have it add them together and set my totalPoints as 70?
Next after it runs all of this i want it to tell me what i need on the assignments not done yet for each grade letter for example 4 assignments worth 25 a piece i want lets say if i got 20 20 20 on the first 3 i want it to tell me i need 0 points on assignment 4 for a D 10 for a C 20 for a B and that its impossible to get an A
Im just a little confused on what code i would need to do that and how i would have it do it for say multiple assignments, if i had 5 and had done 3 i want it to tell me the minimums on 4 and 5 without going over their maximum points, for example if 4 was worth 30 and 5 was worth 20 and i needed a total of 30 points i dont want it to say i need 30 on 4 and 0 on 5 i want it to say i need 15 each, and so on and so forth, im hoping this area doesnt get more complicated than i think it is in my head haha
import java.util.Scanner; public class Prog5 { public static void main(String args[]) { int numberOfGrades; int grades = 0; int gradesDone = 0; int completed; int totalPoints = 0; int points; int pointsEarned; Scanner input = new Scanner( System.in ); System.out.println("How many total grades will there be? "); numberOfGrades = input.nextInt(); do { grades++; System.out.println("Points possible for assignment " + grades + ":"); points = input.nextInt(); }while (grades < numberOfGrades); totalPoints = points; System.out.println("How many assignments completed?"); completed = input.nextInt(); do { gradesDone++; System.out.println("Points recieved on assignment " + gradesDone + ":"); pointsEarned = input.nextInt(); }while (gradesDone < completed); System.out.println(totalPoints); System.out.println(pointsEarned); } }