https://github.com/skylar-lorena/toy-problems
JavaScript Toy Problems
https://github.com/skylar-lorena/toy-problems
beginner-project functions html-css-javascript javascript javascript-for-beginners javascript-game toy-problems
Last synced: 6 months ago
JSON representation
JavaScript Toy Problems
- Host: GitHub
- URL: https://github.com/skylar-lorena/toy-problems
- Owner: Skylar-Lorena
- Created: 2023-03-21T06:57:29.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-25T21:16:23.000Z (over 2 years ago)
- Last Synced: 2024-11-13T02:07:19.346Z (over 1 year ago)
- Topics: beginner-project, functions, html-css-javascript, javascript, javascript-for-beginners, javascript-game, toy-problems
- Language: JavaScript
- Homepage: https://skylar-lorena.github.io/Toy-Problems/
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Toy Problems
This repository contains solutions to three toy problems in JavaScript.
## Author
Lorenah M.
## Challenge 1: Student Grade Generator
Write a program that prompts the user to input student marks. The input should be between 0 and 100. Then output the correct grade:
- A > 79
- B - 60 to 79
- C - 59 to 49
- D - 40 to 49
- E - less than 40.
## Challenge 2: Speed Detector
Write a program that takes as input the speed of a car e.g 80. If the speed is less than 70, it should print “Ok”. Otherwise, for every 5 km/s above the speed limit (70), it should give the driver one demerit point and print the total number of demerit points.
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
Write a program whose major task is to calculate an individual’s Net Salary by getting the inputs of basic salary and benefits. Calculate the payee (i.e. Tax), NHIFDeductions, NSSFDeductions, gross salary, and net salary.
**NB:** Use KRA, NHIF, and NSSF values provided in the link below.
- [KRA Tax Rates](https://www.kra.go.ke/en/individual/calculate-tax/calculating-tax/paye)
- [NHIF and NSSF rates](https://www.aren.co.ke/payroll/taxrates.htm)