Question

Note: In mathematics, division by zero is undefined . so, in c++, division by zero is always an error given an integer v...

Note: In mathematics, division by zero is undefined . so, in c++, division by zero is always an error given an integer variable named callsReceived and another integer 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 divison with truncation will do).
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please Rate it

#include
int main()
{
int callsReceived ;
int operatorsOnCall ;
double TotNu=0;
cout<<"Enter the values:";
cin>>callsReceived >>operatorsOnCall ;
if(callsReceived >0 && operatorsOnCall >0)
TotNu=callsReceived/operatorsOnCall ;
if( TotNu>0)
{
cout<<"Calls recceived for Operator:"<}
else
{
cout<<"Invalid data entered";
}
return 0;
}

Add a comment
Know the answer?
Add Answer to:
Note: In mathematics, division by zero is undefined . so, in c++, division by zero is always an error given an integer v...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write in a program in C. NOTE: in mathematics, division by zero is undefined. So, in...

    Write in a program in C. 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".

  • C++ CodeLabs

    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 operatorsOnCalland print out the number of calls received per operator (integer division with truncation will do).code:cin...

  • photos arent too go so the answer there is right but im trying to figure put...

    photos arent too go so the answer there is right but im trying to figure put why codelap took operatorsoncall as > and callsrecieved aas >= if that makes any sense. why not both > or >= Workbend M Mathway Math Pr. Rate My Professors Vonida Vol Instructions Display stdout NOTE: In mathematics, division by zero is undefined. So, in C++, division by zero is always an error Given a int variable named calls Received and another int variable named...

  • C++ Given a int variable named callsReceived and another int variable named operatorsOnCall, write the necessary...

    C++ 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". Valid input for operatorsOnCall is any value greater than 0. Valid input for callsReceived is any value greater than or equal to 0. Revel for...

  • HELP PYTHON 3.0 (NOT JAVA) 1.HTTP is the protocol that governs communications between web servers and...

    HELP PYTHON 3.0 (NOT JAVA) 1.HTTP is the protocol that governs communications between web servers and web clients (i.e. browsers). Part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. Some of the codes and their meanings are listed below: 200, OK (fulfilled) 403, forbidden 404, not found 500, server error Given an int variable status, write a statement that prints out, on a line by...

  • Using C programming

    Using C, create a data file with the first number being an integer. The value of that integer will be the number of further integers which follow it in the file. Write the code to read the first number into the integer variable how_many.Please help me with the file :((This comes from this question:Write the code to dynamically allocate ONE integer variable using calloc (contiguous allocation) or malloc (memory allocation) and have it pointed to by a pointer (of type int...

  • Write the code to dynamically allocate ONE integer variable using calloc (contiguous allocation) or malloc (memory...

    Write the code to dynamically allocate ONE integer variable using calloc (contiguous allocation) or malloc (memory allocation) and have it pointed to by a pointer (of type int * ) named ptr_1. Use ptr_1 to assign the number 7 to that dynamically allocated integer, and in another line use printf to output the contents of that dynamically allocated integer variable. Write the code to dynamically allocate an integer array of length 5 using calloc or malloc and have it pointed...

  • Your task is to develop a large hexadecimal integer calculator that works with hexadecimal integers of...

    Your task is to develop a large hexadecimal integer calculator that works with hexadecimal integers of up to 100 digits (plus a sign). The calculator has a simple user interface, and 10 \variables" (n0, n1, ..., n9) into which hexadecimal integers can be stored. For example a session with your calculator might look like: mac: ./assmt1 > n0=0x2147483647 > n0+0x3 > n0? 0x214748364A > n1=0x1000000000000000000 > n1+n0 > n1? 0x100000000214748364A > n0? 0x214748364A > exit mac: Note: \mac: " is...

  • Tasks Write a program that prints in text mode Project 2 written by YOURNAME And shows...

    Tasks Write a program that prints in text mode Project 2 written by YOURNAME And shows in a graphical way, as shown below, the names stored in a file. The coordinates to print the names will be also read from another file. Here is an example of what your graphic output should look like with the two files that are provided for test purposes. Drawing Panel Adam Bernie Cameron Daniel Fanny Gerard Harold Issac Jackie Raitlyn Note that the colors...

  • Please Use C++ for coding . . Note: The order that these functions are listed, do...

    Please Use C++ for coding . . Note: The order that these functions are listed, do not reflect the order that they should be called. Your program must be fully functional. Submit all.cpp, input and output files for grading. Write a complete program that uses the functions listed below. Except for the printodd function, main should print the results after each function call to a file. Be sure to declare all necessary variables to properly call each function. Pay attention...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT