Giter Site home page Giter Site logo

code-challenge's Introduction

Coding Challenges: JavaScript Toy Problems

This repository contains solutions to three JavaScript toy problems that cover various aspects of programming logic and calculations. Each challenge has a unique focus and provides an opportunity to practice your JavaScript skills.

Challenge 1: Student Grade Generator

Problem Statement

Write a program that prompts the user to input student marks. The input should be between 0 and 100. The program should then output the corresponding grade based on the following scale:

  • A: Greater than 79
  • B: 60 to 79
  • C: 49 to 59
  • D: 40 to 49
  • E: Less than 40

Usage

Run the program and input the student's marks. The program will display the corresponding grade.

Challenge 2: Speed Detector

Problem Statement

Write a program that takes the speed of a car as input. If the speed is less than 70 km/h, it should print "Ok". For every 5 km/h above the speed limit (70 km/h), the program should give the driver one demerit point and print the total number of demerit points. If the driver accumulates more than 12 demerit points, the program should print "License suspended".

Usage

Run the program and input the car's speed. The program will display demerit points or "License suspended" if applicable.

Challenge 3: Net Salary Calculator

Problem Statement

Write a program that calculates an individual's net salary based on the inputs of basic salary and benefits. The program should calculate payee (tax), NHIF deductions, NSSF deductions, gross salary, and net salary.

Usage

Run the program and input the basic salary and benefits. The program will display the calculated net salary along with other deductions and details.

Getting Started

To run any of the challenges, simply execute the respective JavaScript file using a compatible JavaScript runtime or an online JavaScript interpreter.

node Challenge 1: Student Grade Generator.js
node Challenge 2: Speed Detector.js
node Challenge 3: Net Salary Calculator.js

License

This project is licensed under the MIT License - see the (LICENSE) file for details.


Feel free to use, modify, and contribute to these challenges. Happy coding!

code-challenge's People

Contributors

impactconnect avatar

Watchers

 avatar

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.