Answer:
<u> Initial program output (from original program)</u>
Annual salary is: 40000
Monthly salary is: 3333
<u>Program output after workHoursPerWeek = 35</u>
Annual salary is: 35000
Monthly salary is: 2916
<u>Revised program (using variable workWeeksPerYear)</u>
- public static void main(String[] args) {
-
- int hourlyWage = 20;
- int workHoursPerWeek = 35;
- int workWeeksPerYear = 52;
- int annualSalary = 0;
-
- annualSalary = hourlyWage * workHoursPerWeek * workWeeksPerYear;
- System.out.print("Annual salary is: ");
- System.out.println(annualSalary);
-
- System.out.print("Monthly salary is: ");
- System.out.println((hourlyWage * workHoursPerWeek * workWeeksPerYear) / 12);
-
- return;
-
- }
Program output:
Annual salary is: 36400
Monthly salary is: 3033
<u>Revised Program after introducing monthly salary</u>
- public static void main(String[] args) {
-
- int hourlyWage = 20;
- int workHoursPerWeek = 35;
-
- int workWeeksPerYear = 52;
- int annualSalary = 0;
- int monthlySalary = 0;
-
- annualSalary = hourlyWage * workHoursPerWeek * workWeeksPerYear;
- monthlySalary = hourlyWage * workHoursPerWeek * workWeeksPerYear;
-
- System.out.print("Annual salary is: ");
- System.out.println(annualSalary);
-
- System.out.print("Monthly salary is: ");
- System.out.println((monthlySalary) / 12);
-
- return;
-
- }
Explanation:
One reason to use variable to replace the magic number is to improve the readability of the program. If we compared the revised version of the program with the original program, we will find that the variable enable our code easier to understand.
Besides, if we wish to change the value (e.g. working hours per year or per month), we just need to adjust the value assigned on the variables. The variables provide a single access point to get or change the value.
Answer:
A drawing/graphics tablet
Explanation:
It is ideal for artists, due to it being very similar to as if you were to draw on paper. The stylus replicates a pencil or pen.
Answer:
1. cookies
2.domain name
3.web browser as web saver name
4.html
Explanation:
sana makatulong
Co-pay: Term often used in health care, insurance covers part of the cost and you pay the rest. Seeing in this situation you are paying for the insurance itself, the term is not correct.
Deductible: An insurance term for when you have to pay a certain amount before insurance will cover the rest.
Premium: A fee payed by the insured (Jan) to be covered. This is my best guess for your answer.
Claim: A claim is when Jan would request the insurance company to reimburse her after a car accident (or her tires got slashed, etc.)