GithubHelp home page GithubHelp logo

week1-toy-problems's Introduction

Student Grade Generator

Author

Alexander Nyaga

Description

The calculateGrade function determines the grade depending on the value of the marks input using a simple if-else condition. The textContent property is used to display the grade once it has been determined in the grade paragraph element.

Check out the function:

function calculateGrade(){
let Marks = parseFloat(prompt(`Enter student marks (between 0 and 100):`));
let grade;
if (marks > 79){
grade = "A";
}else if (marks>= 60){
grade = "B"
}else if (marks >= 50) {
grade = "C"
}else if(marks>= 40) {
grade ="D"
}else{
grade = "E"
}
console.log(`The student's grade is: ${grade}`);
 }

Clone this Repository

Clone this program from Github using the git clone command. git clone {Github link}

Speed Detector

Description

This speed detector program measures a driver's speed, assigns demerit points for speeding, and warns the driver that their license may be suspended if their demerit points is exceed 12

Check out the Program code

   const speedLimit = 70;
  let demeritPoints = 0;
  const speedDifference = speed - speedLimit;
 if(speedDifference <= 70) {
console.log("Ok");
}else{
demeritPoints = Math.floor(speedDifference / 5);
console.log("Points", demeritPoints);
if(demeritPoints > 12) {
    console.log("License suspended");
}

}

Net Salary Calculator

Description

This JavaScript program utilizes a prompt to collect information regarding basic pay and benefits, then uses payee (tax) calculations to determine gross pay, payee (tax), NHIF deductions, NSSF deductions, and net pay. The results are then displayed in the console.

week1-toy-problems's People

Contributors

alexander784 avatar lexanders7 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.