Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
!**/*.svg
*.log
.DS_Store






72 changes: 49 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
# Gradebook App
In this mini project, you will get to
review JavaScript fundamentals like functions,

In this mini project, you will get to
review JavaScript fundamentals like functions,
variables, conditionals and more by building a gradebook app.

This will give you an opportunity to solve
This will give you an opportunity to solve
small problems and get a better understanding of the basics.



### Technologies

<table>
<thead>
<tr>
<th height=33 width=91>JavaScript</th>
</tr>
</thead>
<tbody>
<tr>
<td height=33 width=91>
<a href=https://ecma-international.org/publications-and-standards/standards/>
<img src=https://github.com/AndriiKot/JS__Gradebook_App__FreeCodeCamp/blob/main/icons/javascript-1.svg alt=JavaScript>
</a>
</td>
</tr>
</tbody>
</table>

#### - [Full Code](#full-code)

- [Step 1](#step-1)
Expand All @@ -18,27 +37,29 @@ small problems and get a better understanding of the basics.
- [Step 4](#step-4)
- [Step 4 Solution](#step-4-solution)

#### - [back to top](#gradebook-App)

### Step 1

A teacher has finished grading their students'
A teacher has finished grading their students'
tests and needs your help to calculate the average score for the class.

Complete the getAverage function which takes
Complete the getAverage function which takes
in an array of test scores and returns the average score.

The average is calculated by adding
The average is calculated by adding
up all the scores and dividing by the total number of scores.

average = sum of all scores / total number of scores
A couple of function calls have been
A couple of function calls have been
provided for you so you can test out your code.


###### Tips

You can use a loop to iterate
You can use a loop to iterate
over the scores array and add up all the scores.
You can use the length property
You can use the length property
to get the total number of scores.

### Step 1 Solution
Expand All @@ -52,17 +73,19 @@ console.log(getAverage([92, 88, 12, 77, 57, 100, 67, 38, 97, 89]));
console.log(getAverage([45, 87, 98, 100, 86, 94, 67, 88, 94, 95]));
```

#### - [back to top](#gradebook-App)

### Step 2

Now the teacher needs your help
Now the teacher needs your help
converting the student score to a letter grade.

Complete the getGrade function that
takes a number score as a parameter.
Your function should return a string
Complete the getGrade function that
takes a number score as a parameter.
Your function should return a string
representing a letter grade based on the score.

Here are the scores and their
Here are the scores and their
corresponding letter grades:

Score Range Grade
Expand Down Expand Up @@ -93,7 +116,7 @@ Remember that you learned about comparison operators (>, <, >=, <=, ===).

for (const [grade, condition] of Object.entries(grades)) {
if (condition) {
return grade;
return grade;
}
}
}
Expand All @@ -103,6 +126,8 @@ console.log(getGrade(82));
console.log(getGrade(56));
```

#### - [back to top](#gradebook-App)

### Step 3

The teacher is really happy with the
Expand Down Expand Up @@ -132,6 +157,7 @@ Use the getGrade function to get the
student's grade. Then check if the
grade is passing or not.

#### - [back to top](#gradebook-App)

### Step 4

Expand Down Expand Up @@ -170,16 +196,20 @@ function studentMsg(totalScores, studentScore) {
}
```

#### - [back to top](#gradebook-App)

###### Tips

Use the getAverage function to get the class average.
Use the getGrade function to get the student's grade.
Use string concatenation (+) to build the message.
Be careful with the punctuation and spaces in the message.

#### - [back to top](#gradebook-App)

## Full Code

```js
```js

function hasPassingGrade(score) {
return score > 59;
Expand Down Expand Up @@ -215,8 +245,4 @@ function studentMsg(totalScores, studentScore) {
}`;
}
```





#### - [back to top](#gradebook-App)
Loading