• Language

    Java using JOptionPane

  • Description

    Create a pseudocode based on the calculation on Student grades restricted to below conditions
    - The user must input the Marks based on each Of Assessment: Q1, Q2, Q3, Project 1, Project 2, Assignment 1, Assignment 2, Midterm, Final.
    - The Distribution Percentage of each Type of Assessment are listed below. Calculate the total Marks based on the input marks for each assessment.

    | Assessment | Percentage (%) |
    | Quiz (Q1 to Q3) | 9 |
    | Project (Project 1 and Project 2) | 30 |
    | Assignment (Assignment 1 and Assignment 2) | 16 |
    | Midterm | 15 |
    | Final | 30 |

    - Below is the Grade based on Marks. Output the Grade based on the calculated marks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import javax.swing.JOptionPane;

public class StudentGradesCalculation {

    public static void main (String[] args) {
        double Assignment_1, Assignment_2, Final, Marks, Midterm;
        double Point, Project_1, Project_2, Q1, Q2;
        double Q3;
        Assignment_1 = Double.parseDouble(JOptionPane.showInputDialog("Enter the value of Assignment 1"));
        Assignment_2 = Double.parseDouble(JOptionPane.showInputDialog("Enter the value of Assignment 2"));
        Final = Double.parseDouble(JOptionPane.showInputDialog("Enter the value of Final"));
        Midterm = Double.parseDouble(JOptionPane.showInputDialog("Enter the value of Midterm"));
        Project_1 = Double.parseDouble(JOptionPane.showInputDialog("Enter the value of Project 1"));
        Project_2 = Double.parseDouble(JOptionPane.showInputDialog("Enter the value of Project 2"));
        Q1 = Double.parseDouble(JOptionPane.showInputDialog("Enter the value of Q1"));
        Q2 = Double.parseDouble(JOptionPane.showInputDialog("Enter the value of Q2"));
        Q3 = Double.parseDouble(JOptionPane.showInputDialog("Enter the value of Q3"));
        Marks=(Q1+Q2+Q3)*0.09/3+(Project_1+Project_2)*0.3/2+(Assignment_1+Assignment_2)*0.16/2+Midterm*0.15+Final*0.3;
        Point=0;
        if(Marks>=90&&Marks<=100)
        {
            JOptionPane.showMessageDialog(null, "Grade: A+");
            Point=4;
        }
        if(Marks>=80&&Marks<90)
        {
            JOptionPane.showMessageDialog(null, "Grade: A");
            Point=4;
        }
        if(Marks>=75&&Marks<80)
        {
            JOptionPane.showMessageDialog(null, "Grade: A-");
            Point=3.67;
        }
        if(Marks>=70&&Marks<75)
        {
            JOptionPane.showMessageDialog(null, "Grade: B+");
            Point=3.33;
        }
        if(Marks>=65&&Marks<70)
        {
            JOptionPane.showMessageDialog(null, "Grade: B");
            Point=3;
        }
        if(Marks>=60&&Marks<65)
        {
            JOptionPane.showMessageDialog(null, "Grade: B-");
            Point=2.67;
        }
        if(Marks>=55&&Marks<60)
        {
            JOptionPane.showMessageDialog(null, "Grade: C+");
            Point=2.33;
        }
        if(Marks>=50&&Marks<55)
        {
            JOptionPane.showMessageDialog(null, "Grade: C");
            Point=2;
        }
        if(Marks>=45&&Marks<50)
        {
            JOptionPane.showMessageDialog(null, "Grade: C-");
            Point=1.67;
        }
        if(Marks>=40&&Marks<45)
        {
            JOptionPane.showMessageDialog(null, "Grade: D+");
            Point=1.33;
        }
        if(Marks>=35&&Marks<40)
        {
            JOptionPane.showMessageDialog(null, "Grade: D");
            Point=1;
        }
        if(Marks>=30&&Marks<35)
        {
            JOptionPane.showMessageDialog(null, "Grade: D-");
            Point=0.37;
        }
        if(Marks<30)
                JOptionPane.showMessageDialog(null, "Grade: E");
        JOptionPane.showMessageDialog(null,
            "Value of Marks: " + Marks + "\n" +
            "Value of Point: " + Point);
    }

}