public class CourseGrade {
public static void main(String[] args) {
int examWeight = 70;
int labWeight = 20;
int hwWeight = 10;
double examScore;
double labScore;
double hwScore;
double finalScore;
//ask Student to input scores for exam, lab, hw
IO.output("Enter your exam scores: ");
examScore = IO.inputDouble();
IO.output("Enter your lab scores: ");
labScore = IO.inputDouble();
IO.output("Enter your homework scores: ");
hwScore = IO.inputDouble();
//compute final score as the weighted sum of exam, lab, hw score
examScore = examScore * (examWeight / 100);
labScore = labScore * (labWeight / 100);
hwScore = hwScore * (hwWeight / 100);
finalScore = examScore + labScore + hwScore;
// output the final score
IO.outputln("Your final score is: " + finalScore);
}
}
I was getting this error:
undeclared variable:IO again and again, and this solution problem is not available on the web
I am running this code in bluej editor for java
in my opinion io part is just related to the syntax
You would need the IO class which contains several methods to run your code. The IO class might look something like this:
Too use with your code: