Answer:
import java.util.Scanner;
public class TestClock {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter number of prices");
int numberOfPrizes = in.nextInt();
System.out.println("Enter number of participants");
int numberOfParticipants = in.nextInt();
boolean isDivisible;
if(numberOfPrizes%numberOfParticipants==0){
isDivisible=true;
System.out.println("True");
}
else {
isDivisible=false;
System.out.println("False");
}
}
}
Step-by-step explanation:
Using Java Language;
- Prompt user to enter the number of prices and number of participants using the scanner class
- receive and save values in the variables numberOfPrizes and numberOfParticipants
- Create a boolean variable (isDivisible)
- Using if statement and the modulo operator (%) which returns the remainder of division check if numberOfPrizes divieds evenly by numberOfParticipants.