NOTE: in mathematics, division by zero is undefined. So, in C++, division by zero is always an error. Given a int variable named callsReceived and another int variable named operatorsOnCall write the necessary code to read values into callsReceived and operatorsOnCall and print out the number of calls received per operator (integer division with truncation will do). HOWEVER: if any value read in is not valid input, just print the message "INVALID".

Respuesta :

Answer:

#include <iostream>

using namespace std;

int main()

{  

   int callsReceived, operatorsOnCall;

   cout<<"Enter the number of received calls:";

   cin >> callsReceived;

   cout<<"Enter the number of operators on calls:";

   cin >> operatorsOnCall;

   

   if(operatorsOnCall !=0)

       cout<< "Number of calls received per operator is: "<< callsReceived/callsReceived;

   else

       cout<<"INVALID";

   return 0;

}

Explanation:

Declare the variables

Ask the user for the inputs

Check if the second number is 0 or not. If it is not, calculate the number of calls received per operator - divide callsReceived by callsReceived, and print the result

Otherwise, print INVALID