Challenge: Making a Salary Calculator
Oppgave
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 23
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Fantastisk!
Completion rate forbedret til 1.33
Challenge: Making a Salary Calculator
Sveip for å vise menyen
Oppgave
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 23
single