[Solved] Having Trouble in a Java Assignment Finding the Maximum Value from a Loop [closed]


if(major.equals("CIS"))
CIS_total=gpa+gpa;
if(major.equals("Math"))
Math_total=gpa+gpa;

should be

if(major.equals("CIS"))
    CIS_total += gpa;
if(major.equals("Math"))
    Math_total += gpa;

And don’t calculate the average in the loop. Do it after the loop.

3

solved Having Trouble in a Java Assignment Finding the Maximum Value from a Loop [closed]