java - BlueJ Illegal start of expression error -


i'm in online computer science class @ high school. i'm working on program supposed take in grades of several students outside document , calculate final percent students receives course , letter grade goes along using driver class , main class. (note there 4 grades each student 2 quizzes 1 midterm , 1 final, quizzes graded out of ten , worth 25% of final grade combined. midterm worth 25% , final worth 50%.) every time try compile code gets hung on if loop used determine final letter grade, don't know wrong it, appreciated.

main code

public class studentrecord {     private int quiz1;     private int quiz2;     private int midterm;     private int test;     private double finalpercent;     private char finalgrade;     public studentrecord()     {         quiz1 = null;         quiz2 = null;         midterm = null;         test = null;     }     public studentrecord(int t, int m, int q1, int q2)     {         quiz1 = q1*10;         quiz2 = q2*10;         midterm = m;         test = t;     }     public void settest(int t)     {         test=t;     }     public void setmidterm(int m)     {         midterm=m;     }     public void setquiz2(int q2)     {         quiz2=q2*10;     }     public void setquiz1(int q1)     {         quiz1=q1*10;     }     public void setfinalpercent(int quiz1, int quiz2, int midterm, int test)     {         finalpercent = ((quiz1+quiz2)/2)*.25+midterm*.25+test*.5;     }     public void setfinalgrade(double finalpercent)     {         if (finalpercent => 90) error happens         {             finalgrade = a;         }         else if (finalpercent<=89&&finalpercent=>80)         {             finalgrade = b;         }         else if {finalpercent<=79&&finalpercent=>70}         {             finalgrade = c;         }         else if {finalpercent<=69&&finalpercent=>60}         {             finalgrade = d;         }         else          {             finalgrade = f;         }     }     public int getquiz1()     {         return quiz1;     }     public int getquiz2()     {         return quiz2;     }     public int getmidterm()     {         return midterm;     }      public int gettest()     {         return test;     }     public double getfinalpercent()     {     return finalpercent;         }     public char getfinalgrade()     {         return finalgrade;     }     public void inputinfo(scanner.infile)     {         private      } } 

driver code

public class studentrecorddriver {     public static void main(string[] args)     {          scanner infile = null;         try         {             infile = new scanner(new file("349f.txt"));         }         catch (filenotfoundexception e)         {             system.out.println("file not found");             system.exit(0);         }         system.out.pritnln("studet\tquiz1\tquiz2\tmidterm\tfinal\tfinal%\tgrade");         int student = 1;         while (infile.hasnext())         {             string[] grades = infile.nextline().split(" ");             int quiz1 = integer.valueof(grade[0]);             int quiz2 = integer.valueof(grade[1]);             int midterm = integer.valueof(grade[2]);             int test = integer.valueof(grade[3]);             studentrecord student = new studentrecord(int test, int midterm, int quiz1, int quiz2);     system.out.println(student+"\t"+student.getquiz1+"\t"+student.getquiz2+"\t"+student.getmidterm+"\t"+student.gettest+"\t"+student.getfinalpercent+"\t"+student.getfinalgrade);;         }     } } 

you have lot of syntax errors. example, can't null int, integer, midterm = null example. comparison => isn't valid, it's >= error coming from. have '{}' around if conditions, should ()... name few.

i don't know bluej if it's missing basic things that, might want switch better ide eclipse. clear lot of basic mistakes might have.


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -