Challenge: Making a Salary Calculator
Opgave
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_RATEwith a value of25.00. - Declare & initialize a variable called
hoursWorkedwith a value of164. - Declare a variable called
totalPayand set it equal to the product ofhoursWorkedandHOURLY_RATE. - Use a
console.logline to output the following message:The calculated total payment is: X, whereXshould be the calculatedtotalPay.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 23
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Fantastisk!
Completion rate forbedret til 1.33
Challenge: Making a Salary Calculator
Stryg for at vise menuen
Opgave
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_RATEwith a value of25.00. - Declare & initialize a variable called
hoursWorkedwith a value of164. - Declare a variable called
totalPayand set it equal to the product ofhoursWorkedandHOURLY_RATE. - Use a
console.logline to output the following message:The calculated total payment is: X, whereXshould be the calculatedtotalPay.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 23
single