test

mail@pastecode.io avatar
unknown
java
2 years ago
1.5 kB
8
Indexable
Never
package com.ACT5A_Mayor_3;

import java.util.Scanner;

public class ACT5A_Mayor_3 {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int assgmnt;
        int act;
        int assmnt;
        int exam;
        int fgrade;

        System.out.print("Enter your assignment: ");
        assgmnt = scan.nextInt();
        System.out.print("Enter your activity: ");
        act = scan.nextInt();
        System.out.print("Enter your assessment: ");
        assmnt = scan.nextInt();
        System.out.print("Enter your exam: ");
        exam = scan.nextInt();
        scan.close();

        fgrade = (assgmnt + act + assmnt + exam) / 4;

        if (fgrade >= 98 && fgrade <= 100) {
            System.out.println("Your final grade is " + fgrade + " = EXCELLENT" );
        }
        else if (fgrade >= 89 && fgrade <= 97) {
            System.out.println("Your final grade is " + fgrade + " = VERY GOOD" );
        }
        else if (fgrade >= 83 && fgrade <= 88) {
            System.out.println("Your final grade is " + fgrade + " = GOOD" );
        }
        else if (fgrade >= 80 && fgrade <= 82) {
            System.out.println("Your final grade is " + fgrade + " = FAIR" );
        }
        else if (fgrade >= 75 && fgrade <= 79) {
            System.out.println("Your final grade is " + fgrade + " = PASSED" );
        }
        else
            System.out.println("Your final grade is " + fgrade + " = FAILED" );
        }

    }