Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Making a Salary Calculator | Manipulating Data
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Introduction to JavaScript

bookChallenge: Making a Salary Calculator

Task

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.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 9
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Can you explain this in simpler terms?

What are some examples related to this topic?

Where can I learn more about this?

close

bookChallenge: Making a Salary Calculator

Swipe to show menu

Task

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.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 9
single

single

some-alt