SectionΒ 1. ChapterΒ 22
single
Challenge: Making a Salary Calculator
Swipe to show menu
Task
Swipe to start coding
You are assigned a task to build a salary calculator. The company has a fixed hourly pay for all employees. The salary is calculated by multiplying the number of hours worked by the fixed hourly rate.
Your tasks:
- Declare and initialize a constant called
HOURLY_RATEwith a value of25.00. - Declare and initialize a variable called
hoursWorkedwith a value of164. - Declare a variable called
totalPayand set it equal to the product ofhoursWorkedandHOURLY_RATE. - Output the following message:
The calculated total payment is: X
Where X is the calculated totalPay.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 22
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat