So for the final of my Java class, I'm making a calculator that will tell you want you need to get on a final exam to get a certain grade in the class depending on the weight of the final. The code that I have so far is very simple as it's a Java I class, but I've tried everything I can think of and have had the same error for the past week.
Here's what I have so far,
Source can be found here http://www.mediafire.com/?ok3g47043lvs2cg
Any and all help is greatly appreciated.
Here's what I have so far,
Code:
import java.util.Scanner;
public class eocGradeCalc {
public static void main(String[] args) {
int desired; //Desired grade.
int current; // Current grade.
int percent; // Percentage of the total grade for which the final test counts.
double result;
int gradeNeeded; //Grade you need on test.
double percentWeight; // Percent remaining subtracting final's weight. Use decimals.
Scanner stdio = new Scanner( System.in );
System.out.print("Enter your desired grade in the class: ");
TextIO.getInt();
desired = stdio.nextInt();
stdio.nextLine();
System.out.print("Enter your current grade in the class: ");
TextIO.getInt();
current = stdio.nextInt();
stdio.nextLine();
System.out.print("Enter the weight of the test(10% = .1): ");
TextIO.getDouble();
percent = stdio.nextInt();
percentWeight = 0;
if (percent == .1)
percentWeight = .9;
if (percent == .15)
percentWeight = .85;
if (percent == .20)
percentWeight = .80;
stdio.nextLine();
gradeNeeded = (current) + (desired * percent);
result = desired * percentWeight;
//Examples
//.9(68.94) + .1(x) = 70
//x = 79.54
//.85(68.94) + .15(x) = 70
//x = 76.01
System.out.printf("%1.2f", result);
System.out.println();
System.out.println("You will need to get");
System.out.printf("%1.2f", gradeNeeded);
System.out.println("to get a");
System.out.printf("%1.2f", desired);
System.out.println("percent in the class.");
System.out.println();
}
}
Any and all help is greatly appreciated.