I haven't finished writing this and im confused on how to do this. i need to output the averages together and indiviually(major,minor,other)-NOT FINISHED need input on what to do. you have to ask the user to continuing entering grades until they enter a negative number.
import java.util.Scanner;
public class GradingTwo
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
double grade = 0.0;
double majAvg = 0.0;
double minAvg = 0.0;
double othAvg = 0.0;
double catMaj = 0.7;
double catMin = 0.2;
double catOth = 0.1;
int count = 0;
while(grade>=0 && grade<=100)
{
System.out.println("Input a numeric grade from 0 to 100: ");
grade = keyboard.nextDouble();
if(grade<0)
break;
System.out.println("Input a grade category: ");
String gradeCat = keyboard.next();
if(gradeCat=="major")
{
majAvg+=grade;
count = count + 1;
}
else if(gradeCat=="minor")
minAvg+=grade;
else if(gradeCat=="other")
othAvg+=grade;
System.out.println();
}
System.out.println("Major Average " + (majAvg/count));
}
}