This repository was archived by the owner on May 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 254
Expand file tree
/
Copy pathmain.js
More file actions
34 lines (25 loc) · 1.26 KB
/
main.js
File metadata and controls
34 lines (25 loc) · 1.26 KB
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
'use strict'
/*
4. PROJECT: Grade calculator
Every week ends with a project you have to build on your own. Instead of getting clear-cut instructions, you'll get a list of criteria that your project needs to measure up to.
In this project you'll write a function that calculates grades, based on the American grading system! Let's say a student did a test and they got a 60 out of 100, this function will:
convert the score into a percentage
calculate what grade corresponds with that percentage, and
shows in the command line the result: the grade and the percentage
In this example this is what we would expect the function to return in the command line:
You got a D (60%)!
When writing the function, make use of the following grade scores:
Grade A (90% - 100%)
Grade B (80% - 89%)
Grade C (70% - 79%)
Grade D (60% - 69%)
Grade E (50% - 59%)
Grade F (0% - 49%)
These are the requirements your project needs to fulfill:
Make a JavaScript file with a name that describes its contents
Use either a switch or if/else statement
Write at least 2 comments that explain to others what a line of code is meant to do
Make the return value of the function a template string, so you can insert variables!
Use node from the command line to test if your code works as expected
Good luck!
*/