Ask Question
1 February, 13:01

Given a int variable named calls Received and another int variable named operators On Call write the necessary code to read values into calls Received and operators On Call and print out the number of calls received per operator (integer division with truncation will do).

+5
Answers (1)
  1. 1 February, 16:55
    0
    import java. util. Scanner;

    public class CocaColaVendingTest {

    public static void main (String[] args) {

    Scanner input = new Scanner (System. in);

    System. out. println ("Enter the total number of calls received");

    int callsReceived = input. nextInt ();

    System. out. println ("Enter the total number of operators");

    int operatorsOnCall = input. nextInt ();

    int callsPerOperator = callsReceived/operatorsOnCall;

    System. out. println ("The number of calls per operator is "+callsPerOperator);

    }

    }

    Explanation:

    A complete Java code is given above. The user is prompted to enter the values for the number of calls received and the number of operators. These are stored in the respective variables.

    Using an Integer division, the number of calls per operator is obtained by: callsPerOperator = callsReceived/operatorsOnCall;
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Given a int variable named calls Received and another int variable named operators On Call write the necessary code to read values into ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers