1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ivanzaharov [21]
3 years ago
8

Write an expression that evaluates to true if the value of the int variable numberOfPrizes is divisible (with no remainder) by t

he int variable numberOfParticipants. Assume that numberOfParticipants is not zero.
Computers and Technology
1 answer:
Elodia [21]3 years ago
6 0

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");

        }

   }

}

Explanation:

Using Java Language;

  1. Prompt user to enter the number of prices and number of participants using the scanner class
  2. receive and save values in the variables numberOfPrizes and numberOfParticipants
  3. Create  a boolean variable (isDivisible)
  4. Using if statement and the modulo operator (%) which returns the remainder of division check if numberOfPrizes divieds evenly by numberOfParticipants.
You might be interested in
Question 1 of 20 :
tekilochka [14]
With style comes difference. Style is a personal thing that will change among individuals, so B
7 0
4 years ago
Read 2 more answers
Which of the following formats can algorithms NOT be written in:
umka2103 [35]
Hello there.

Which of the following formats can algorithms NOT be written in:

Answers: Flow Chart 
5 0
2 years ago
Read 2 more answers
The part of the poppet valve that contacts the valve seat is called the A. face. B. margin. C. head. D. stem.
Phantasy [73]
It should be A face, I think
6 0
3 years ago
Read 2 more answers
Notes on secondary memory​
gladu [14]

Answer:

non-volatile and persistent in nature

7 0
3 years ago
If you can't get the keys away from a drunk friend, it is better to call the police than to let them drive drunk. A. True B. Fal
joja [24]

I.T it's true

I hope it helps

6 0
4 years ago
Other questions:
  • The left column values in a table array are called table ____
    13·1 answer
  • The ____ category of apps makes the computer easier for blind people to use.
    9·1 answer
  • How do i unblock website on my school computer
    7·2 answers
  • What is a scholary or systemic investigation or injury about a subject?
    14·1 answer
  • A solid understanding of __________ is the foundation of verbal communication
    7·1 answer
  • L00000000000000000000000000000000000000000000000000000000l they b00ty tickled
    6·2 answers
  • Which symbol is at the beginning and end of a multiline comment block? ### &&& %%% """
    14·1 answer
  • What is 36 Denary in Binary?? PLEASE ANSWER I WILL GIVE U BRAINLY!!
    9·2 answers
  • How do you convert an algorithm to make it possible for a computer to read
    6·1 answer
  • Can anyone help me figure out why my if statements are not executing properly? When the program executes with 7 as the value for
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!