Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Not too sure what is wrong with the following code. I believe that it is somethi

ID: 3637974 • Letter: N

Question

Not too sure what is wrong with the following code. I believe that it is something to do with the denominator being zero but not sure.

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

code:

cin >> callsReceived;
cin >> operatorsOnCall;
if ( operatorsOnCall > 0)
cout << (callsReceived / operatorsOnCall );

Explanation / Answer

cin >> callsReceived; cin >> operatorsOnCall; if ( operatorsOnCall > 0) cout > commands
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote