Ask Question
17 February, 04:26

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).

+2
Answers (1)
  1. 17 February, 06:37
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers