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.
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
Run the program and input the student's marks. The program will display the corresponding grade.
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".
Run the program and input the car's speed. The program will display demerit points or "License suspended" if applicable.
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.
Run the program and input the basic salary and benefits. The program will display the calculated net salary along with other deductions and details.
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
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!