Giter Club home page Giter Club logo

grading-js's Introduction

Grading

You work for a school, and you need to help the teachers come up with some analytics about their students.

Challenge 1 - Determining differences

You are given an array of grades. You need to process this array, and return an array that describes whether each grade was higher, lower or even to the previous grade.

So given the following array:

[6,3,5,4,3,4,4,5]

Your code would produce:

["down","up","down","down","up","even","up"]

When given an empty array, it returns an empty array.

NOTE: your array tracks the differences between grades, so it will be one item shorter than the given array.

Challenge 2 - Finding students in decline

A student is considered in decline if they have 3 grades lower than previous grades, even if there are some steady grades in there. Look for 3 "down" movements that are either a) separated by "even"s or b) consecutive.

For example:

[10, 10, 10, 9, 9, 8, 8, 8, 8, 7] // ["even", "even", "down", "even", "down", "even", "even", "even", "down"]
[10, 10, 10, 9, 9, 8, 8, 8, 8, 7] // in decline

[10, 10, 10, 11, 9, 8, 8, 8, 8, 7] // ["even", "even", "up", "even", "down", "even", "even", "even", "down"]
[10, 10, 10, 11, 9, 8, 8, 8, 8, 7] // not in decline

[10, 9, 8, 7] // ["down", "down", "down"]
[10, 9, 8, 7] // in decline

[10, 9, 8, 7, 8] // ["down", "down", "down", "up"]
[10, 9, 8, 7, 8] // not in decline

[10, 9, 8] // ["down", "down"]
[10, 9, 8] // not in decline

Challenge 3 - Check your code

There are 27 students in decline in the data/grades.json files, and 73 students not in decline.

Run your code against this file and make sure it matches.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.