Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Making a Salary Calculator | Manipulating Data
Introduction to JavaScript

Pyyhkäise näyttääksesi valikon

book
Challenge: Making a Salary Calculator

Tehtävä

Swipe to start coding

You are assigned a task for making a salary calculator. The company has a fixed hourly pay for all the employees. The salary is calculated by multiplying the number of hours worked with the fixed hourly pay.

  • Declare & initialize a constant called hourly_rate with a value of 25.00.
  • Declare & initialize a variable called hoursWorked with a value of 164.
  • Declare a variable called totalPay and set it equal to the product of hoursWorked and hourly_rate.
  • Use a console.log line to output the following message: The calculated total payment is: X, where X should be the calculated totalPay.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 9

Kysy tekoälyä

expand
ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

book
Challenge: Making a Salary Calculator

Tehtävä

Swipe to start coding

You are assigned a task for making a salary calculator. The company has a fixed hourly pay for all the employees. The salary is calculated by multiplying the number of hours worked with the fixed hourly pay.

  • Declare & initialize a constant called hourly_rate with a value of 25.00.
  • Declare & initialize a variable called hoursWorked with a value of 164.
  • Declare a variable called totalPay and set it equal to the product of hoursWorked and hourly_rate.
  • Use a console.log line to output the following message: The calculated total payment is: X, where X should be the calculated totalPay.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 9
Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Pahoittelemme, että jotain meni pieleen. Mitä tapahtui?
some-alt