Computers and Technology, 27.02.2020 19:06 cherylmorton7302
The following program uses a variable workHoursPerWeek rather than directly using 40 in the salary calculation expression.
Run the program, observe the output. Change 40 to 35 (France's work week), and run again.
Generalize the program further by using a variable workWeeksPerYear. Run the program. Change 50 to 52, and run again.
Introduce a variable monthlySalary, used similarly to annualSalary, to further improve program readability.
public class Salary {
public static void main (String [] args) {
int hourlyWage = 20;
int workHoursPerWeek = 40;
// FIXME: Define and initialize variable workWeeksPerYear, then replace the 50's below
int annualSalary = 0;
annualSalary = hourlyWage * workHoursPerWeek * 50;
System. out. print("Annual salary is: ");
System. out. println(annualSalary);
System. out. print("Monthly salary is: ");
System. out. println((hourlyWage * workHoursPerWeek * 50) / 12);
return;
}
}
Answers: 2
Computers and Technology, 22.06.2019 21:00, bryanatwin1536
Describir textbook icon_person mira los dibujos y describe lo que está pasando. usa los verbos de la lista.
Answers: 1
Computers and Technology, 23.06.2019 21:20, FlowerChild1229
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
Computers and Technology, 24.06.2019 12:00, yagalneedshelp8338
Match the function to its purpose. fast worth 50pts.
Answers: 1
The following program uses a variable workHoursPerWeek rather than directly using 40 in the salary c...
Chemistry, 17.07.2019 05:00
Social Studies, 17.07.2019 05:00
Health, 17.07.2019 05:00
Biology, 17.07.2019 05:00
History, 17.07.2019 05:00
Mathematics, 17.07.2019 05:00
Social Studies, 17.07.2019 05:00