Report Card Average
JavaScript
20 pts
Report Card Average
Abel’s marks came from a form as text (see the starter).
- Create
average: convert the three marks to numbers (NumberorparseFloat), add them and divide by 3. Print"Average:"with one decimal (toFixed(1)). - Create
rounded: the average rounded to a whole number usingNumber(average.toFixed(0)). Print"Rounded:"androunded. - Print
"Is integer:"andNumber.isInteger(rounded). - Print
"Binary:"androundedin binary withtoString(2).
Expected output:
Average: 85.8 Rounded: 86 Is integer: true Binary: 1010110
Checklist
- Convert the marks and calculate
average. - Create the whole number
roundedand check it. - Show
roundedin binary. - The four lines match.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
