-
Language
PHP
-
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Student grades calculation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<?php
<html>
<head>
<title>Student grades calculation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
if ($_SERVER['REQUEST_METHOD']=='POST')
{
$Assignment_1 = floatval ($_POST['Assignment_1']);
$Assignment_2 = floatval ($_POST['Assignment_2']);
$Final = floatval ($_POST['Final']);
$Midterm = floatval ($_POST['Midterm']);
$Project_1 = floatval ($_POST['Project_1']);
$Project_2 = floatval ($_POST['Project_2']);
$Q1 = floatval ($_POST['Q1']);
$Q2 = floatval ($_POST['Q2']);
$Q3 = floatval ($_POST['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)
{
echo 'Grade: A+<br>'
$Point=4;
}
if($Marks>=80&&$Marks<90)
{
echo 'Grade: A<br>'
$Point=4;
}
if($Marks>=75&&$Marks<80)
{
echo 'Grade: A-<br>'
$Point=3.67;
}
if($Marks>=70&&$Marks<75)
{
echo 'Grade: B+<br>'
$Point=3.33;
}
if($Marks>=65&&$Marks<70)
{
echo 'Grade: B<br>'
$Point=3;
}
if($Marks>=60&&$Marks<65)
{
echo 'Grade: B-<br>'
$Point=2.67;
}
if($Marks>=55&&$Marks<60)
{
echo 'Grade: C+<br>'
$Point=2.33;
}
if($Marks>=50&&$Marks<55)
{
echo 'Grade: C<br>'
$Point=2;
}
if($Marks>=45&&$Marks<50)
{
echo 'Grade: C-<br>'
$Point=1.67;
}
if($Marks>=40&&$Marks<45)
{
echo 'Grade: D+<br>'
$Point=1.33;
}
if($Marks>=35&&$Marks<40)
{
echo 'Grade: D<br>'
$Point=1;
}
if($Marks>=30&&$Marks<35)
{
echo 'Grade: D-<br>'
$Point=0.37;
}
if($Marks<30)
echo 'Grade: E<br>'
echo 'Value of Marks: ' . $Marks . "<br/>\n";
echo 'Value of Point: ' . $Point . "<br/>\n";
}
<form method="post">
<table style="text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<td>
<label for="Assignment_1">Enter the value of Assignment 1:</label>
</td>
<td>
<input name="Assignment_1" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Assignment_2">Enter the value of Assignment 2:</label>
</td>
<td>
<input name="Assignment_2" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Final">Enter the value of Final:</label>
</td>
<td>
<input name="Final" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Midterm">Enter the value of Midterm:</label>
</td>
<td>
<input name="Midterm" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Project_1">Enter the value of Project 1:</label>
</td>
<td>
<input name="Project_1" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Project_2">Enter the value of Project 2:</label>
</td>
<td>
<input name="Project_2" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Q1">Enter the value of Q1:</label>
</td>
<td>
<input name="Q1" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Q2">Enter the value of Q2:</label>
</td>
<td>
<input name="Q2" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Q3">Enter the value of Q3:</label>
</td>
<td>
<input name="Q3" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr align="center">
<td colspan="2" rowspan="1">
<input value="Process" type="submit" />
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
<table style="text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<td>
<label for="Assignment_1">Enter the value of Assignment 1:</label>
</td>
<td>
<input name="Assignment_1" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Assignment_2">Enter the value of Assignment 2:</label>
</td>
<td>
<input name="Assignment_2" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Final">Enter the value of Final:</label>
</td>
<td>
<input name="Final" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Midterm">Enter the value of Midterm:</label>
</td>
<td>
<input name="Midterm" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Project_1">Enter the value of Project 1:</label>
</td>
<td>
<input name="Project_1" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Project_2">Enter the value of Project 2:</label>
</td>
<td>
<input name="Project_2" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Q1">Enter the value of Q1:</label>
</td>
<td>
<input name="Q1" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Q2">Enter the value of Q2:</label>
</td>
<td>
<input name="Q2" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr>
<td>
<label for="Q3">Enter the value of Q3:</label>
</td>
<td>
<input name="Q3" required="required" step="0.000001" type="number" />
</td>
</tr>
<tr align="center">
<td colspan="2" rowspan="1">
<input value="Process" type="submit" />
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>