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){
<em>//This creates a scanner object</em>
Scanner input = new Scanner(System.in);
<em>//This declares employee number and hours, as integer</em>
int empNum, hrs;
<em>//This declares the rate and pay (salary) as double</em>
double rate,pay;
<em>//This gets input for employee number</em>
empNum = input.nextInt();
<em>//The following while operation is repeated until user inputs -1</em>
while(empNum != - 1){
<em>//This gets input for worked hours</em>
hrs = input.nextInt();
<em>//This gets input for work rate</em>
rate = input.nextDouble();
<em>//This calculates the pay (base salary)</em>
pay = rate * hrs;
<em>//If worked hours is more than 40</em>
if(hrs >40){
<em>//This calculates the additional pay</em>
pay += 0.5 * pay;
}
<em>//This prints the total salary</em>
System.out.println("Salary: "+pay);
<em>//This gets input for the employee number </em>
empNum = input.nextInt();
}
}
}<em>// The program ends here</em>
At the end of the program, the program prints the employee's salary
See attachment for sample run
Read more about java programs at:
brainly.com/question/15831954