Respuesta :
The program illustrates the use of repetitive operations.
The program in java is as follows, where comments are used to explain each line
import java.util.*;
public class Main{
public static void main(String [] args){
//This creates a scanner object
Scanner input = new Scanner(System.in);
//This declares employee number and hours, as integer
int empNum, hrs;
//This declares the rate and pay (salary) as double
double rate,pay;
//This gets input for employee number
empNum = input.nextInt();
//The following while operation is repeated until user inputs -1
while(empNum != - 1){
//This gets input for worked hours
hrs = input.nextInt();
//This gets input for work rate
rate = input.nextDouble();
//This calculates the pay (base salary)
pay = rate * hrs;
//If worked hours is more than 40
if(hrs >40){
//This calculates the additional pay
pay += 0.5 * pay;
}
//This prints the total salary
System.out.println("Salary: "+pay);
//This gets input for the employee number
empNum = input.nextInt();
}
}
}// The program ends here
At the end of the program, the program prints the employee's salary
See attachment for sample run
Read more about java programs at:
https://brainly.com/question/15831954
