1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OLga [1]
3 years ago
13

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".
Computers and Technology
1 answer:
erik [133]3 years ago
3 0

Answer:

The code to this question can be given as:

Code:

int callsReceived,operatorsOnCall;    //define variable  as integer

Scanner ob= new Scanner(System.in);    

//create object of scanner class for user input

System.out.println("Insert the value of callsReceived");  //print message.

callsReceived = ob.nextInt();    //input value.

System.out.println("Insert the value of operatorsOnCall"); //print message.  

operatorsOnCall = ob.nextInt();    //input value.

if (operatorsOnCall == 0)  //check number  

{

System.out.println("INVALID");   //print message.

}

else

{

System.out.println(callsReceived/operatorsOnCall);   //print value.

}

Explanation:

In the above code firstly we define 2 integer variable that name is already given in the question. Then we create the scanner class object for taking user input. Then we print the message for input first and second value from the user. then we use conditional statement. If the second variable that is  operatorsOnCall is equal to 0. So It print INVALID. else it divide the value and print it.

You might be interested in
Each JavaScript command line ends with a(n) ____ to separate it from the next command line in the program.
kykrilka [37]
The answer is :
semicolon (;)
8 0
2 years ago
Suppose that, even unrealistically, we are to search a list of 700 million items using Binary Search, Recursive (Algorithm 2.1).
damaskus [11]

Answer:

There is also an attachment below

Explanation:

Since we are talking about binary search, let's assume that the items are sorted according to some criteria.

Time complexity of binary search is O(logN) in worst case, best case and average case as well. That means it can search for an item in Log N time where N is size of the input. Here problem talks about the item not getting found. So, this is a worst case scenario. Even in this case, binary search runs in O(logN) time.

N = 700000000.

So, number of comparisions can be log(N) = 29.3 = 29.

So, in the worst case it does comparisions 29 times

7 0
3 years ago
The variable used in a loop to control the number of times it is executed is called a _______.
tia_tia [17]

Answer:

the variable used in a loop to control the number of timer is executed is called a interaction.

Explanation:

a particular way in which matter, fields, and atomic and subatomic particles affect one another

6 0
3 years ago
BIm computer class I need answers please
egoroff_w [7]

Answer:

I think the 3RD

Explanation:

The  reason why I think that is because the other once are not written correctly.

8 0
3 years ago
Read 2 more answers
What caused accident? into passive voice​
lozanna [386]
Accident was caused by what
6 0
2 years ago
Other questions:
  • Skylar is viewing her personal and business calendar in a side-by-side fashion, but she would like to view a single calendar tha
    6·1 answer
  • What is the value of the variable result after these lines of code are executed?
    5·2 answers
  • What type of survey can help a network administrator make decisions about bands, channels, and widths when installing new access
    9·1 answer
  • What is industry 4.0 -automation revolution-, what is your opinion about the direction this revolution is taking the industry in
    8·1 answer
  • Computer programmers often use binary codes (strings of 1s and 0s) to write programs for computers. These codes are then changed
    6·1 answer
  • Explain the components of Information System?​
    13·1 answer
  • What do you call the spreadsheet cell that is in effect and has a heavier black border around it?
    7·2 answers
  • What kind of app or technology would you like to create?  Why ? <br><br><br>​
    11·1 answer
  • Consider Statement 1: All prime numbers greater than 3 are equal to a multiple of six, plus 1 or minus 1. Let P(x) be the statem
    7·1 answer
  • Fort Nite is the best u can’t say it’s not
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!