Grading Students Solution in Javascript

  • Every student receives a grade in the inclusive range from 0 to 100.
  • Any grade less than 40 is a failing grade.
  • grade = 84 round to 85(85–84 is less than 3)
  • grade = 29 do not round (result is less than 40)
  • grade = 57 do not round (60–57 is 3 or higher)
    Given the initial value of grade for each of Sam’s n students, write code to automate the rounding process.
  • int grades[n]: the grades before rounding
  • int[n]: the grades after rounding as appropriate
  • 1 ≤ n ≤ 60
  • 0 ≤ grades[i] ≤100




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

SlateJS by Example: Using Marks

A Smart Angular Spinner - Scoping on App as well as Component

Retrieving data from API’s using Fetch

How to Use Geolocation in React Native With Hooks

Function Scope Vs Block Scope

How to convert typescript code to javascript code

Lesson learned. Adventure time with TypeScript.

CORS headache in ReactJS and Spring boot

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Travis Lee

Travis Lee

More from Medium

Toss a Coin: Creating a Simple Distraction System (Game Dev Day 62)

LeetCode 202. Happy Number

Deep in JavaScript

The Importance of Generic Programming