Skip to content

This repository features a Student Grade Generator, Speed Detector for calculating demerit points, and a Net Salary Calculator for determining net income based on salary and deductions.

License

Notifications You must be signed in to change notification settings

hamaxwel/wk-1-code-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INTRODUCTION

This repository has three JavaScript solutions designed to perform specific tasks: calculating grades, detecting speeding violations, and calculating net salary. Each solution is self-contained and can be tested independently.

SOLUTIONS

Challenge 1: Student Grade Generator (Toy Problem)

The javascript program prompts the user to input student marks. It then makes sure that the input is within the range of 0 and 100. Using the if statement, the program checks through different range of student marks and prints out grades for the different inputs from users. The grades ranges considered are:

To display message to the screen with the student's grade console.log is used. A > 79, B - 60 to 79, C - 59 to 49, D - 40 to 49, E - less 40.

Challenge 2: Speed Detector (Toy Problem)

The Speed detector program takes as input the speed of a car. Using if statement, it checks the speed of the car and if it is less than 70, it prints “Ok”. Otherwise, for every 5 km/s above the speed limit (70), it outputs to the driver one demerit point and print the total number of demerit points.

To display message to the screen with the student's grade window.alert is used. For example, if the speed is 80, it should print: “Points: 2”. If the driver gets more than 12 points, the function should print: “License suspended”.

Challenge 3: Net Salary Calculator (Toy Problem)

The program calculates an individual’s Net Salary by getting the inputs of basic salary and allowances. Calculates the payee (i.e. Tax), NHIFDeductions, NSSFDeductions, gross salary, and net salary.

License

This project is licensed under the MIT License. Feel free to modify and use the code as needed. Contact

For questions or suggestions, please contact Maxwel kirimi at maxwelkirimii@gmail.com.# wk-1-code-challenge

wk-1-code-challenge

About

This repository features a Student Grade Generator, Speed Detector for calculating demerit points, and a Net Salary Calculator for determining net income based on salary and deductions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published