Welcome to Mobilarian Forum - Official Symbianize forum.

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Java Grading program

Alexhost
A 0

ampaosampanotoy

Transcendent
Member
Joined
Jul 24, 2014
Messages
19
Reaction score
3
Points
1
Age
30
grants
₲585
10 years of service
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:

:cool:
:blushing:
 
K 0

Kane

Abecedarian
BANNED
Member
Access
Joined
Oct 10, 2022
Messages
125
Reaction score
60
Points
18
Location
Philippines
grants
₲390
1 years of service
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:

:cool:
:blushing:
Thanks for sharing!
 
Top Bottom