Need help with my logic



I am trying to write a program that will total the number of grades
entered and also give me a total of all the A's B' C's etc. Thanks


Error that I am getting:

Exception in thread "main" java.lang.Error: Unresolved compilation
problems:
numberOfA cannot be resolved //how I am to resolve this and the
others
numberOfB cannot be resolved
numberOfC cannot be resolved
numberOfD cannot be resolved
numberOfF cannot be resolved

at ExamScorer.main(ExamScorer.java:22)

public class ExamScorer
{
public static void main(String[] args)
{


System.out.println("Enter exam score: ");
int score;
char grade;
int sum;
int next;
String answer;
int countGrade = 0;
int countScore = 0;
Scanner keyboard = new Scanner(System.in);

{
System.out.println();
System.out.println("Enter all of the exam scores.");
sum=0;
int NumberOfA = 0;
int NumberOfB = 0;
int NumberOfC = 0;
int NumberOfD = 0;
int NumberOfF = 0;
next = keyboard.nextInt();
score = keyboard.nextInt();
grade = keyboard.next();

}
sum = sum + next;
numberOfA++;
numberOfB++;
numberOfC++;
numberOfD++;
numberOfF++;
next = keyboard.nextInt();


if (score >= 90)
grade = 'A';
else if (score >= 80)
grade = 'B';
else if (score >= 70)
grade = 'C';
else if (score >= 60)
grade = 'D';
else
grade = 'F';


System.out.println("Score = " + score);
countScore++;
System.out.println("Grade = " + grade);
countGrade++;


}

}

.



Relevant Pages

  • Re: help with getting to end report
    ... Customer_ID Month Customer Customer Network ... SELECT DISTINCTROW [Tbl Customer].Network, ... AS [B Grade Quantity], ... AS [Sum Of A Grade Sales Units], ...
    (microsoft.public.access.queries)
  • Re: How do I sum numbers up to an certain threshold in Excel?
    ... class by class and it will simply sum everything because ... > hours, third is grade, fourth is weighted grade points: ... So I don't think SUMIF ... >>> So far I've create a GPA calculator where you place credit hours in one ...
    (microsoft.public.excel.misc)
  • Re: help with getting to end report
    ... Tbl Customer ... Reason (the lines are A Grade, ... I need a report to show the following by Network: but I also need it to ... Sum of Gross to Net/Quantity ...
    (microsoft.public.access.queries)
  • Re: Conditional sum dependant on VLOOKUP
    ... Problably a SUMPRODUCT function will do what you need. ... this will sum the hours in column B for the person 'person_name'. ... have to admit I did not understood your 'grade part'. ... > One of these rows specifies a person in the heading and how many ...
    (microsoft.public.excel.worksheet.functions)
  • help with getting to end report
    ... Tbl Customer ... Reason (the lines are A Grade, ... I need a report to show the following by Network: but I also need it to ... Sum of Gross to Net/Quantity ...
    (microsoft.public.access.queries)