FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Javascript_implementation/gradecalc.js at main · TheCodeCipher/Javascript_implementation · GitHub
TheCodeCipher
/
Javascript_implementation
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Javascript_implementation
/
gradecalc.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (26 loc) · 707 Bytes
Breadcrumbs
Javascript_implementation
/
gradecalc.js
Copy path
File metadata and controls
28 lines (26 loc) · 707 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
function
calculateGrade
(
)
{
let
marks
=
document
.
getElementById
(
"marks"
)
.
value
;
let
grade
;
if
(
marks
>
100
)
{
grade
=
"Error: Marks cannot exceed 100."
;
}
else
if
(
marks
<
0
)
{
grade
=
"Error: Marks cannot be negative."
;
}
else
if
(
marks
>=
95
)
{
grade
=
"A+ (Outstanding)"
;
}
else
if
(
marks
>=
90
)
{
grade
=
"A+"
;
}
else
if
(
marks
>=
80
)
{
grade
=
"A"
;
}
else
if
(
marks
>=
70
)
{
grade
=
"B"
;
}
else
if
(
marks
>=
60
)
{
grade
=
"C"
;
}
else
if
(
marks
>=
50
)
{
grade
=
"D"
;
}
else
if
(
marks
>=
0
)
{
grade
=
"F (Fail)"
;
}
document
.
getElementById
(
"result"
)
.
innerHTML
=
`Your Grade: <strong>
${
grade
}
</strong>`
;
}
Back
|
FazBrowse Home
|
New Git URL