Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/359.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为什么赢了';我的主人不知道我回来了什么吗?_Java_Methods_Return - Fatal编程技术网

Java 为什么赢了';我的主人不知道我回来了什么吗?

Java 为什么赢了';我的主人不知道我回来了什么吗?,java,methods,return,Java,Methods,Return,我无法让我的程序识别eClassGpa和sClassGpa,即使我在它们的方法中返回了它们。我正在尝试将所有的GPA都添加到单独方法中。当我这样做时,我返回的两件事会产生错误 import java.util.Scanner; public class GPA3 { public static void main(String[] args) { System.out.println("Hello! Welcome to the GPA Calculator.

我无法让我的程序识别eClassGpa和sClassGpa,即使我在它们的方法中返回了它们。我正在尝试将所有的GPA都添加到单独方法中。当我这样做时,我返回的两件事会产生错误

import java.util.Scanner;
public class GPA3 {

    public static void main(String[] args) 
    {
        System.out.println("Hello! Welcome to the GPA Calculator.");

        int Math;
        double mathGpa = 0;

        System.out.println("Math = ");
        Scanner input = new Scanner(System.in);
        Math= input.nextInt();

        if (Math >100){
            System.out.println("You have mistyped something");
        }
        if (Math >= 94){
            System.out.println("You have an A");
            mathGpa = 4.0;
            System.out.println(mathGpa);
        }
        if (Math < 94 && Math >=90){
            System.out.println("You have an A-");
            mathGpa = 3.7;
            System.out.println(mathGpa);
        }
        if (Math < 90 && Math >=87){
            System.out.println("You have a B+");
            mathGpa = 3.3;
            System.out.println(mathGpa);
        }
        if (Math < 87 && Math >=80){
            System.out.println("You have a B");
            mathGpa = 3.0;
            System.out.println(mathGpa);
        }
        if (Math < 80 && Math >=77){
            System.out.println("You have a B-");
            mathGpa = 2.7;
            System.out.println(mathGpa);
        }
        if (Math < 77 && Math >=73){
            System.out.println("You have a C+");
            mathGpa = 2.3;
            System.out.println(mathGpa);
        }
        if (Math < 73 && Math >=70){
            System.out.println("You have a C");
            mathGpa = 2.0;
            System.out.println(mathGpa);
        }
        if (Math < 70 && Math >=67){
            System.out.println("You have a C-");
            mathGpa = 1.7;
            System.out.println(mathGpa);
        }
        if (Math < 67 && Math >=67){
            System.out.println("You have a D+");
            mathGpa = 1.3;
            System.out.println(mathGpa);
        }
        if (Math < 67 && Math >=63){
            System.out.println("You have a D");
            mathGpa = 1.0;
            System.out.println(mathGpa);
        }
        if (Math < 63 && Math >=60){
            System.out.println("You have a D-");
            mathGpa = 0.7;
            System.out.println(mathGpa);
        }
        if (Math < 60){
            System.out.println("You have a F");
            mathGpa = 0.0;
            System.out.println(mathGpa);
        }//End of Math

        int English;
        double englishGpa = 0;
        System.out.println("English = ");
        English= input.nextInt();

        if (English >100){
            System.out.println("You have mistyped something");
        }
        if (English >= 94 && English <101){
            System.out.println("You have an A");
            englishGpa = 4.0;
            System.out.println(englishGpa);
        }
        if (English < 94 && English >=90){
            System.out.println("You have an A-");
            englishGpa = 3.7;
            System.out.println(englishGpa);
        }
        if (English < 90 && English >=87){
            System.out.println("You have a B+");
            englishGpa = 3.3;
            System.out.println(englishGpa);
        }
        if (English < 87 && English >=80){
            System.out.println("You have a B");
            englishGpa = 3.0;
            System.out.println(englishGpa);
        }
        if (English < 80 && English >=77){
            System.out.println("You have a B-");
            englishGpa = 2.7;
            System.out.println(englishGpa);
        }
        if (English < 77 && English >=73){
            System.out.println("You have a C+");
            englishGpa = 2.3;
            System.out.println(englishGpa);
        }
        if (English < 73 && English >=70){
            System.out.println("You have a C");
            englishGpa = 2.0;
            System.out.println(englishGpa);
        }
        if (English < 70 && English >=67){
            System.out.println("You have a C-");
            englishGpa = 1.7;
            System.out.println(englishGpa);
        }
        if (English < 67 && English >=67){
            System.out.println("You have a D+");
            englishGpa = 1.3;
            System.out.println(englishGpa);
        }
        if (English < 67 && English >=63){
            System.out.println("You have a D");
            englishGpa = 1.0;
            System.out.println(englishGpa);
        }
        if (English < 63 && English >=60){
            System.out.println("You have a D-");
            englishGpa = 0.7;
            System.out.println(englishGpa);
        }
        if (English < 60){
            System.out.println("You have a F");
            englishGpa = 0.0;
            System.out.println(englishGpa);
        }//End of English

        int Science;
        double SciGpa = 0;
        System.out.println("Science = ");
        Science= input.nextInt();

        if (Science >100){
            System.out.println("You have mistyped something");
        }
        if (Science >= 94 && Science <101){
            System.out.println("You have an A");
            SciGpa = 4.0;
            System.out.println(SciGpa);
        }
        if (Science < 94 && Science >=90){
            System.out.println("You have an A-");
            SciGpa = 3.7;
            System.out.println(SciGpa);
        }
        if (Science < 90 && Science >=87){
            System.out.println("You have a B+");
            SciGpa = 3.3;
            System.out.println(SciGpa);
        }
        if (Science < 87 && Science >=80){
            System.out.println("You have a B");
            SciGpa = 3.0;
            System.out.println(SciGpa);
        }
        if (Science < 80 && Science >=77){
            System.out.println("You have a B-");
            SciGpa = 2.7;
            System.out.println(SciGpa);
        }
        if (Science < 77 && Science >=73){
            System.out.println("You have a C+");
            SciGpa = 2.3;
            System.out.println(SciGpa);
        }
        if (Science < 73 && Science >=70){
            System.out.println("You have a C");
            SciGpa = 2.0;
            System.out.println(SciGpa);
        }
        if (Science < 70 && Science >=67){
            System.out.println("You have a C-");
            SciGpa = 1.7;
            System.out.println(SciGpa);
        }
        if (Science < 67 && Science >=67){
            System.out.println("You have a D+");
            SciGpa = 1.3;
            System.out.println(SciGpa);
        }
        if (Science < 67 && Science >=63){
            System.out.println("You have a D");
            SciGpa = 1.0;
            System.out.println(SciGpa);
        }
        if (Science < 63 && Science >=60){
            System.out.println("You have a D-");
            SciGpa = 0.7;
            System.out.println(SciGpa);
        }
        if (Science < 60){
            System.out.println("You have a F");
            SciGpa = 0.0;
            System.out.println(SciGpa);
        }//End of Science

        int Spanish;
        double SpanGpa = 0;
        System.out.println("Spanish = ");
        Spanish= input.nextInt();

        if (Spanish >100){
            System.out.println("You have mistyped something");
        }
        if (Spanish >= 94 && Spanish <101){
            System.out.println("You have an A");
            SpanGpa = 4.0;
            System.out.println(SpanGpa);
        }
        if (Spanish < 94 && Spanish >=90){
            System.out.println("You have an A-");
            SpanGpa = 3.7;
            System.out.println(SpanGpa);
        }
        if (Spanish < 90 && Spanish >=87){
            System.out.println("You have a B+");
            SpanGpa = 3.3;
            System.out.println(SpanGpa);
        }
        if (Spanish < 87 && Spanish >=80){
            System.out.println("You have a B");
            SpanGpa = 3.0;
            System.out.println(SpanGpa);
        }
        if (Spanish < 80 && Spanish >=77){
            System.out.println("You have a B-");
            SpanGpa = 2.7;
            System.out.println(SpanGpa);
        }
        if (Spanish < 77 && Spanish >=73){
            System.out.println("You have a C+");
            SpanGpa = 2.3;
            System.out.println(SpanGpa);
        }
        if (Spanish < 73 && Spanish >=70){
            System.out.println("You have a C");
            SpanGpa = 2.0;
            System.out.println(SpanGpa);
        }
        if (Spanish < 70 && Spanish >=67){
            System.out.println("You have a C-");
            SpanGpa = 1.7;
            System.out.println(SpanGpa);
        }
        if (Spanish < 67 && Spanish >=67){
            System.out.println("You have a D+");
            SpanGpa = 1.3;
            System.out.println(SpanGpa);
        }
        if (Spanish < 67 && Spanish >=63){
            System.out.println("You have a D");
            SpanGpa = 1.0;
            System.out.println(SpanGpa);
        }
        if (Spanish < 63 && Spanish >=60){
            System.out.println("You have a D-");
            SpanGpa = 0.7;
            System.out.println(SpanGpa);
        }
        if (Spanish < 60){
            System.out.println("You have a F");
            SpanGpa = 0.0;
            System.out.println(SpanGpa);
        }//End of Spanish

        int Religion;
        double RGpa = 0;
        System.out.println("Religion = ");
        Religion= input.nextInt();

        if (Religion >100){
            System.out.println("You have mistyped something");
        }
        if (Religion >= 94 && Religion < 101){
            System.out.println("You have an A");
            RGpa = 4.0;
            System.out.println(RGpa);
        }
        if (Religion < 94 && Religion >=90){
            System.out.println("You have an A-");
            RGpa = 3.7;
            System.out.println(RGpa);
        }
        if (Religion < 90 && Religion >=87){
            System.out.println("You have a B+");
            RGpa = 3.3;
            System.out.println(RGpa);
        }
        if (Religion < 87 && Religion >=80){
            System.out.println("You have a B");
            RGpa = 3.0;
            System.out.println(RGpa);
        }
        if (Religion < 80 && Religion >=77){
            System.out.println("You have a B-");
            RGpa = 2.7;
            System.out.println(RGpa);
        }
        if (Religion < 77 && Religion >=73){
            System.out.println("You have a C+");
            RGpa = 2.3;
            System.out.println(RGpa);
        }
        if (Religion < 73 && Religion >=70){
            System.out.println("You have a C");
            RGpa = 2.0;
            System.out.println(RGpa);
        }
        if (Religion < 70 && Religion >=67){
            System.out.println("You have a C-");
            RGpa = 1.7;
            System.out.println(RGpa);
        }
        if (Religion < 67 && Religion >=67){
            System.out.println("You have a D+");
            RGpa = 1.3;
            System.out.println(RGpa);
        }
        if (Religion < 67 && Religion >=63){
            System.out.println("You have a D");
            RGpa = 1.0;
            System.out.println(RGpa);
        }
        if (Religion < 63 && Religion >=60){
            System.out.println("You have a D-");
            RGpa = 0.7;
            System.out.println(RGpa);
        }
        if (Religion < 60){
            System.out.println("You have a F");
            RGpa = 0.0;
            System.out.println(RGpa);
        }//End of Religion 
        answer(input);
        elective(input);

        double finalGrade;
        finalGrade= mathGpa + englishGpa+ SciGpa+ sClassGpa + eClassGpa;


    }//End of Main

    public static double answer(Scanner input)
        {//Begin answer
        double sClassGpa=0;
        System.out.println("Do you have gym this semester?");
        input.nextLine();
        String yes = "yes";
        String no = "no";
        String answer = input.nextLine();

        if (answer.equals(yes)){
            int Gym;
            System.out.println("Gym = ");
            Gym= input.nextInt();
            if (Gym >100){
                System.out.println("You have mistyped something");
            }
            if (Gym >= 94 && Gym < 101){
                System.out.println("You have an A");
                sClassGpa = 4.0;
                System.out.println(sClassGpa);
            }
            if (Gym < 94 && Gym >=90){
                System.out.println("You have an A-");
                sClassGpa = 3.7;
                System.out.println(sClassGpa);
            }
            if (Gym < 90 && Gym >=87){
                System.out.println("You have a B+");
                sClassGpa = 3.3;
                System.out.println(sClassGpa);
            }
            if (Gym < 87 && Gym >=80){
                System.out.println("You have a B");
                sClassGpa = 3.0;
                System.out.println(sClassGpa);
            }
            if (Gym < 80 && Gym >=77){
                System.out.println("You have a B-");
                sClassGpa = 2.7;
                System.out.println(sClassGpa);
            }
            if (Gym < 77 && Gym >=73){
                System.out.println("You have a C+");
                sClassGpa = 2.3;
                System.out.println(sClassGpa);
            }
            if (Gym < 73 && Gym >=70){
                System.out.println("You have a C");
                sClassGpa = 2.0;
                System.out.println(sClassGpa);
            }
            if (Gym < 70 && Gym >=67){
                System.out.println("You have a C-");
                sClassGpa = 1.7;
                System.out.println(sClassGpa);
            }
            if (Gym < 67 && Gym >=67){
                System.out.println("You have a D+");
                sClassGpa = 1.3;
                System.out.println(sClassGpa);
            }
            if (Gym < 67 && Gym >=63){
                System.out.println("You have a D");
                sClassGpa = 1.0;
                System.out.println(sClassGpa);
            }
            if (Gym < 63 && Gym >=60){
                System.out.println("You have a D-");
                sClassGpa = 0.7;
                System.out.println(sClassGpa);
            }
            if (Gym < 60){
                System.out.println("You have a F");
                sClassGpa = 0.0;
                System.out.println(sClassGpa);
            }
        }//End Gym

        if (answer.equals(no)){
            int History;
            System.out.println("History = ");
            History= input.nextInt();

            if (History >100){
                System.out.println("You have mistyped something");
            }
            if (History >= 94 && History <101){
                System.out.println("You have an A");
                sClassGpa = 4.0;
                System.out.println(sClassGpa);
            }
            if (History < 94 && History >=90){
                System.out.println("You have an A-");
                sClassGpa = 3.7;
                System.out.println(sClassGpa);
            }
            if (History < 90 && History >=87){
                System.out.println("You have a B+");
                sClassGpa = 3.3;
                System.out.println(sClassGpa);
            }
            if (History < 87 && History >=80){
                System.out.println("You have a B");
                sClassGpa = 3.0;
                System.out.println(sClassGpa);
            }
            if (History < 80 && History >=77){
                System.out.println("You have a B-");
                sClassGpa = 2.7;
                System.out.println(sClassGpa);
            }
            if (History < 77 && History >=73){
                System.out.println("You have a C+");
                sClassGpa = 2.3;
                System.out.println(sClassGpa);
            }
            if (History < 73 && History >=70){
                System.out.println("You have a C");
                sClassGpa = 2.0;
                System.out.println(sClassGpa);
            }
            if (History < 70 && History >=67){
                System.out.println("You have a C-");
                sClassGpa = 1.7;
                System.out.println(sClassGpa);
            }
            if (History < 67 && History >=67){
                System.out.println("You have a D+");
                sClassGpa = 1.3;
                System.out.println(sClassGpa);
            }
            if (History < 67 && History >=63){
                System.out.println("You have a D");
                sClassGpa = 1.0;
                System.out.println(sClassGpa);
            }
            if (History < 63 && History >=60){
                System.out.println("You have a D-");
                sClassGpa = 0.7;
                System.out.println(sClassGpa);
            }
            if (History < 60){
                System.out.println("You have a F");
                sClassGpa = 0.0;
                System.out.println(sClassGpa);
            }//End of History
        }

        return (sClassGpa);
    }//End answer

    public static double elective(Scanner input)
    {//Begin answer
    double eClassGpa=0;
    System.out.println("Do you have one or two electives this year?");
    System.out.println("Hint: write answers in word form");
    input.nextLine();
    String one = "one";
    String two = "two";
    String elective = input.nextLine();

    if (elective.equals(one)){
        int electiveOne;
        System.out.println("Elective 1 = ");
        electiveOne= input.nextInt();
        if (electiveOne >100){
            System.out.println("You have mistyped something");
        }
        if (electiveOne >= 94 && electiveOne < 101){
            System.out.println("You have an A");
            eClassGpa = 4.0;
            System.out.println(eClassGpa);
        }
        if (electiveOne < 94 && electiveOne >=90){
            System.out.println("You have an A-");
            eClassGpa = 3.7;
            System.out.println(eClassGpa);
        }
        if (electiveOne < 90 && electiveOne >=87){
            System.out.println("You have a B+");
            eClassGpa = 3.3;
            System.out.println(eClassGpa);
        }
        if (electiveOne < 87 && electiveOne >=80){
            System.out.println("You have a B");
            eClassGpa = 3.0;
            System.out.println(eClassGpa);
        }
        if (electiveOne < 80 && electiveOne >=77){
            System.out.println("You have a B-");
            eClassGpa = 2.7;
            System.out.println(eClassGpa);
        }
        if (electiveOne < 77 && electiveOne >=73){
            System.out.println("You have a C+");
            eClassGpa = 2.3;
            System.out.println(eClassGpa);
        }
        if (electiveOne < 73 && electiveOne >=70){
            System.out.println("You have a C");
            eClassGpa = 2.0;
            System.out.println(eClassGpa);
        }
        if (electiveOne < 70 && electiveOne >=67){
            System.out.println("You have a C-");
            eClassGpa = 1.7;
            System.out.println(eClassGpa);
        }
        if (electiveOne < 67 && electiveOne >=67){
            System.out.println("You have a D+");
            eClassGpa = 1.3;
            System.out.println(eClassGpa);
        }
        if (electiveOne < 67 && electiveOne >=63){
            System.out.println("You have a D");
            eClassGpa = 1.0;
            System.out.println(eClassGpa);
        }
        if (electiveOne < 63 && electiveOne >=60){
            System.out.println("You have a D-");
            eClassGpa = 0.7;
            System.out.println(eClassGpa);
        }
        if (electiveOne < 60){
            System.out.println("You have a F");
            eClassGpa = 0.0;
            System.out.println(eClassGpa);
        }


    }//End Elective 1

    if(elective.equals(two)){

        double e1ClassGpa=0;
        double e2ClassGpa=0;

        if (elective.equals(two)){
            int electiveOne;
            System.out.println("Elective 1 = ");
            electiveOne= input.nextInt();
            if (electiveOne >100){
                System.out.println("You have mistyped something");
            }
            if (electiveOne >= 94 && electiveOne < 101){
                System.out.println("You have an A");
                e1ClassGpa = 4.0;
                System.out.println(e1ClassGpa);
            }
            if (electiveOne < 94 && electiveOne >=90){
                System.out.println("You have an A-");
                e1ClassGpa = 3.7;
                System.out.println(e1ClassGpa);
            }
            if (electiveOne < 90 && electiveOne >=87){
                System.out.println("You have a B+");
                e1ClassGpa = 3.3;
                System.out.println(e1ClassGpa);
            }
            if (electiveOne < 87 && electiveOne >=80){
                System.out.println("You have a B");
                e1ClassGpa = 3.0;
                System.out.println(e1ClassGpa);
            }
            if (electiveOne < 80 && electiveOne >=77){
                System.out.println("You have a B-");
                e1ClassGpa = 2.7;
                System.out.println(e1ClassGpa);
            }
            if (electiveOne < 77 && electiveOne >=73){
                System.out.println("You have a C+");
                e1ClassGpa = 2.3;
                System.out.println(e1ClassGpa);
            }
            if (electiveOne < 73 && electiveOne >=70){
                System.out.println("You have a C");
                e1ClassGpa = 2.0;
                System.out.println(e1ClassGpa);
            }
            if (electiveOne < 70 && electiveOne >=67){
                System.out.println("You have a C-");
                e1ClassGpa = 1.7;
                System.out.println(e1ClassGpa);
            }
            if (electiveOne < 67 && electiveOne >=67){
                System.out.println("You have a D+");
                e1ClassGpa = 1.3;
                System.out.println(e1ClassGpa);
            }
            if (electiveOne < 67 && electiveOne >=63){
                System.out.println("You have a D");
                e1ClassGpa = 1.0;
                System.out.println(e1ClassGpa);
            }
            if (electiveOne < 63 && electiveOne >=60){
                System.out.println("You have a D-");
                e1ClassGpa = 0.7;
                System.out.println(e1ClassGpa);
            }
            if (electiveOne < 60){
                System.out.println("You have a F");
                e1ClassGpa = 0.0;
                System.out.println(e1ClassGpa);
            }

        }//End Elective 1

        int elective2;
        System.out.println("Elective 2 = ");
        elective2= input.nextInt();

        if (elective2 >100){
            System.out.println("You have mistyped something");
        }
        if (elective2 >= 94 && elective2 <101){
            System.out.println("You have an A");
            e2ClassGpa = 4.0;
            System.out.println(e2ClassGpa);
        }
        if (elective2 < 94 && elective2 >=90){
            System.out.println("You have an A-");
            e2ClassGpa = 3.7;
            System.out.println(e2ClassGpa);
        }
        if (elective2 < 90 && elective2 >=87){
            System.out.println("You have a B+");
            e2ClassGpa = 3.3;
            System.out.println(e2ClassGpa);
        }
        if (elective2 < 87 && elective2 >=80){
            System.out.println("You have a B");
            e2ClassGpa = 3.0;
            System.out.println(e2ClassGpa);
        }
        if (elective2 < 80 && elective2 >=77){
            System.out.println("You have a B-");
            e2ClassGpa = 2.7;
            System.out.println(e2ClassGpa);
        }
        if (elective2 < 77 && elective2 >=73){
            System.out.println("You have a C+");
            e2ClassGpa = 2.3;
            System.out.println(e2ClassGpa);
        }
        if (elective2 < 73 && elective2 >=70){
            System.out.println("You have a C");
            e2ClassGpa = 2.0;
            System.out.println(e2ClassGpa);
        }
        if (elective2 < 70 && elective2 >=67){
            System.out.println("You have a C-");
            e2ClassGpa = 1.7;
            System.out.println(e2ClassGpa);
        }
        if (elective2 < 67 && elective2 >=67){
            System.out.println("You have a D+");
            e2ClassGpa = 1.3;
            System.out.println(e2ClassGpa);
        }
        if (elective2 < 67 && elective2 >=63){
            System.out.println("You have a D");
            e2ClassGpa = 1.0;
            System.out.println(e2ClassGpa);
        }
        if (elective2 < 63 && elective2 >=60){
            System.out.println("You have a D-");
            e2ClassGpa = 0.7;
            System.out.println(e2ClassGpa);
        }
        if (elective2 < 60){
            System.out.println("You have a F");
            e2ClassGpa = 0.0;
            System.out.println(e2ClassGpa);
        }//End of Elective 2
        eClassGpa= e1ClassGpa + e2ClassGpa;
        }//End of ElectiveTwo
    input.close();
    return (eClassGpa);
    }//End of Elective

}//End of Class
import java.util.Scanner;
公共级GPA3{
公共静态void main(字符串[]args)
{
System.out.println(“您好!欢迎使用GPA计算器”);
整数数学;
双mathGpa=0;
System.out.println(“Math=”);
扫描仪输入=新扫描仪(System.in);
Math=input.nextInt();
如果(数学>100){
System.out.println(“您输入了错误的内容”);
}
如果(数学>=94){
System.out.println(“您有一个A”);
mathGpa=4.0;
System.out.println(mathGpa);
}
如果(数学<94&&Math>=90){
System.out.println(“您有一个A-”);
mathGpa=3.7;
System.out.println(mathGpa);
}
如果(数学<90&&Math>=87){
System.out.println(“您有一个B+”);
mathGpa=3.3;
System.out.println(mathGpa);
}
如果(数学<87&&Math>=80){
System.out.println(“你有一个B”);
mathGpa=3.0;
System.out.println(mathGpa);
}
如果(数学<80&&Math>=77){
System.out.println(“您有一个B-”);
mathGpa=2.7;
System.out.println(mathGpa);
}
如果(数学<77&&Math>=73){
System.out.println(“您有一个C+”);
mathGpa=2.3;
System.out.println(mathGpa);
}
如果(数学<73&&Math>=70){
System.out.println(“你有一个C”);
mathGpa=2.0;
System.out.println(mathGpa);
}
如果(数学<70&&Math>=67){
System.out.println(“您有一个C-”);
mathGpa=1.7;
System.out.println(mathGpa);
}
如果(数学<67&&Math>=67){
System.out.println(“您有一个D+”);
mathGpa=1.3;
System.out.println(mathGpa);
}
如果(数学<67&&Math>=63){
System.out.println(“你有一个D”);
mathGpa=1.0;
System.out.println(mathGpa);
}
如果(数学<63&&Math>=60){
System.out.println(“您有一个D-”);
mathGpa=0.7;
System.out.println(mathGpa);
}
如果(数学<60){
System.out.println(“你有一个F”);
mathGpa=0.0;
System.out.println(mathGpa);
}//数学终结
国际英语;
双重英语hgpa=0;
System.out.println(“English=”);
英语=input.nextInt();
如果(英语>100){
System.out.println(“您输入了错误的内容”);
}
如果(英语>=94&&English=90){
System.out.println(“您有一个A-”);
英语hgpa=3.7;
系统输出打印语言(英语版);
}
如果(英语<90&&English>=87){
System.out.println(“您有一个B+”);
英语hgpa=3.3;
系统输出打印语言(英语版);
}
如果(英语<87&&English>=80){
System.out.println(“你有一个B”);
英语hgpa=3.0;
系统输出打印语言(英语版);
}
如果(英语<80&&English>=77){
System.out.println(“您有一个B-”);
英语hgpa=2.7;
系统输出打印语言(英语版);
}
如果(英语<77&&English>=73){
System.out.println(“您有一个C+”);
英语hgpa=2.3;
系统输出打印语言(英语版);
}
如果(英语<73&&English>=70){
System.out.println(“你有一个C”);
英语hgpa=2.0;
系统输出打印语言(英语版);
}
如果(英语<70&&English>=67){
System.out.println(“您有一个C-”);
英语hgpa=1.7;
系统输出打印语言(英语版);
}
如果(英语<67&&English>=67){
System.out.println(“您有一个D+”);
英语hgpa=1.3;
系统输出打印语言(英语版);
}
如果(英语<67&&English>=63){
System.out.println(“你有一个D”);
英语hgpa=1.0;
系统输出打印语言(英语版);
}
如果(英语<63&&English>=60){
System.out.println(“您有一个D-”);
英语hgpa=0.7;
系统输出打印语言(英语版);
}
如果(英语<60){
System.out.println(“你有一个F”);
英语hgpa=0.0;
系统输出打印语言(英语版);
}//英语的结尾
国际科学;
双SciGpa=0;
System.out.println(“Science=”);
科学=输入。nextInt();
如果(科学>100){
System.out.println(“您输入了错误的内容”);
}
如果(科学>=94&&Science=90){
System.out.println(“您有一个A-”);
SciGpa=3.7;
系统输出打印LN(SciGpa);
}
如果(科学<90&&Science>=87){
System.out.println(“您有一个B+”);
SciGpa=3.3;
系统输出打印LN(SciGpa);
}
如果(科学<87&&Science>=80){
System.out.println(“你有一个B”);
SciGpa=3.0;
系统输出打印LN(SciGpa);
}
如果(科学<80&&Science>=77){
System.out.println(“您有一个B-”);
SciGpa=2.7;
系统输出打印LN(SciGpa);
}
如果(科学<77&&Science>=73){
System.out.println(“您有一个C+”);
SciGpa=2.3;
系统输出打印LN(SciGpa);
}
如果(科学<73&&Science>=70){
System.out.println(“您有一个
sClassGpa= answer(input);
eClassGpa = elective(input);
        }//End of Religion 
        answer(input);   //Edit this line...
        elective(input); //And this line

        double finalGrade;
        finalGrade= mathGpa + englishGpa+ SciGpa+ sClassGpa + eClassGpa;   
}//End of Main
public static void main(String[] args){

    // your main method
    // End of Religion

    double sClassGpa = answer(input);
    double eClassGpa = elective(input);

    double finalGrade = mathGpa + englishGpa+ SciGpa+ sClassGpa + eClassGpa;
}