A
0
Class Assign7{
// Do you want to declare any member data before you start your "main()" function?
public static void main(String[] args)throws Exception{
// Is "Record.setGP()" a "static method"?
Record.setGP(1.25, 1.25, 0.25, 0.50);
// Isnt this class-wide data? If so, shouldnt you put it *above* "main()"?
int quiz1, quiz2;
int tMidterm, tFinal,tQuiz
int midterm = 0;
int finalExam = 0;
String name;
char grade;
// Do you really want to just bomb out of the program if this fails?
Scanner myIn = new Scanner( new File("scores.txt") );
// Whoa!!!! Why are we starting a new function, *inside of "main()"*?!?!
void getScore()
{
tQuiz = ((quiz1 + quiz2)/20)*.25;
tMidTerm = (midTermExam/100)*.25;
tFinal = (finalExam/100)*.50;
finalScore = tQuiz + tMidTerm + tFinal;
}
// It looks like were starting a new function here, too.
// Wheres your parenthesis and curly brace after "getLetterGrade"????
void getLetterGrade
if (finalScore >= 90)
{
grade = A;
}
// Supposing the grade was "99"?
// Would the student get a "B" here? Or even a "D" below???
if (finalScore >= 80)
{
grade = B;
}
:challenge:
:blushing:
// Do you want to declare any member data before you start your "main()" function?
public static void main(String[] args)throws Exception{
// Is "Record.setGP()" a "static method"?
Record.setGP(1.25, 1.25, 0.25, 0.50);
// Isnt this class-wide data? If so, shouldnt you put it *above* "main()"?
int quiz1, quiz2;
int tMidterm, tFinal,tQuiz
int midterm = 0;
int finalExam = 0;
String name;
char grade;
// Do you really want to just bomb out of the program if this fails?
Scanner myIn = new Scanner( new File("scores.txt") );
// Whoa!!!! Why are we starting a new function, *inside of "main()"*?!?!
void getScore()
{
tQuiz = ((quiz1 + quiz2)/20)*.25;
tMidTerm = (midTermExam/100)*.25;
tFinal = (finalExam/100)*.50;
finalScore = tQuiz + tMidTerm + tFinal;
}
// It looks like were starting a new function here, too.
// Wheres your parenthesis and curly brace after "getLetterGrade"????
void getLetterGrade
if (finalScore >= 90)
{
grade = A;
}
// Supposing the grade was "99"?
// Would the student get a "B" here? Or even a "D" below???
if (finalScore >= 80)
{
grade = B;
}
:challenge:
:blushing: