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();
}
}