import java.util.Scanner;

public class PrimitivesCalculator {
    public static void main(String[] args) {  
        Scanner input;
        boolean separateCategory;
        float currentGrade;
        float desiredGrade; 
        float percentOfFinal; 

        input = new Scanner(System.in);
        System.out.print("Do you want separate categories? ");
        separateCategory = input.nextBoolean();
        System.out.println(separateCategory);

        if(separateCategory == true) {
            System.out.print("Enter current grade? ");
            currentGrade = input.nextInt();
            System.out.println(currentGrade);
    
            System.out.print("Enter desired grade? ");
            desiredGrade = input.nextInt();
            System.out.println(desiredGrade);

            System.out.print("Enter percent of grade that is final? ");
            percentOfFinal = input.nextFloat();
            System.out.println(percentOfFinal);
    
            input.close();

            float gradeNeeded = (desiredGrade - currentGrade * (1-percentOfFinal))/percentOfFinal;
            System.out.println(gradeNeeded);
        }
    }        

}