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
lapo4ka [179]
3 years ago
14

Given a int variable named calls Received and another int variable named operators On Call write the necessary code to read valu

es into calls Received and operators On Call and print out the number of calls received per operator (integer division with truncation will do).
Computers and Technology
1 answer:
joja [24]3 years ago
4 0

Answer:

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;

You might be interested in
Write an abstract data type for a queue in Java whose elements are generic elements of type T that have an associated integer pr
Nimfa-mama [501]

Answer:

See explaination

Explanation:

#include<iostream>

const int MAX=20;

class dque

{

private:

int arr[MAX];

int front,rear;

public:

dque();

void addqatbeg(char item);

void addqatend(char item);

int delqatbeg();

int delqatend();

void display();

int count();

};

dque::dque()

{

front=rear=-1;

for(int i=0;i<MAX;i++)

arr[i]=0;

}

void dque::addqatbeg(int item)

{

if(front==0&&rear==MAX-1){cout<<"\nDeque is full"<<endl;return;}

if(front==-1){front=rear=0;arr[front]=item;return;}

if(rear!=MAX-1)

{int c=count();int k=rear+1;

for(int i=1;i<=c;i++){arr[k]==arr[k-1];k--;}

arr[k]=item;front=k;rear++;

}

else{front--;arr[front]=item;}

}

void dque::addqatend(int item)

{

if(front==0&&rear==MAX-1){cout<<"\nDeque is full"<<endl;return;}

if(front==-1){front=rear=0;arr[rear]=item;return;}

if(rear==MAX-1){

int k=front-1;

for(int i=front-1;i<rear;i++){k=i;

if(k==MAX-1)arr[k]=0;

else arr[k]=arr[i+1];

}rear++;

arr[rear]=item;

}

int dque::delqatbeg()

{

if(front==-1){cout<<"\nDeque is empty"<<endl;return0;}

int item=arr[front];

arr[front]=0;

if(front==rear)front=rear=-1;

else

front++;

return item;

}

int dque::delqatend()

{

if(front==-1){cout<<"\nDeque is empty"<<endl;return 0;}

int item=arr[rear];

arr[rear]=0;

rear--;

if(rear==-1)front=-1;return item;

}

void dque::display()

{

cout<<endl<<"front->";

for(int i=0;i<MAX;i++)cout<<""<<arr[i];cout<<"<-rear";

}

int dque::count()

{

int c=0;

for (int i=0;i<MAX;i++){if(arr[i]!=0)c++;}

return c;}

}

7 0
3 years ago
Read 2 more answers
What is a tag in an HTML document?
Rashid [163]
Code that specifies how the web page should be formatted
8 0
3 years ago
I think you have been doing a great job but you haven’t been signing many people up for our new service feature I want you to se
STatiana [176]

Answer:

24 customers

Explanation:

Given

Customers = 96

p = 25\% --- proportion to sign up

Required

The number of customers to sign up

This is calculated as:

n = p * Customers

So, we have:

n = 25\% * 96

n = 24

5 0
3 years ago
What are some advantages and disadvantages of streaming and downloading?
stepladder [879]

Answer:

Pro Cons

It is possible to download legitimate music files that do not include DRM and so makes it easier for you to listen to your tracks on different devices. The file may include DRM protection that you were not expecting when you joined the service. Read the fine print.

Explanation:

7 0
3 years ago
In MS Excel, a function is written as =FUNCTION_NAME(_____________________).​
otez555 [7]

Explanation:

A function is a predefined formula that performs calculations using specific values in a particular order. All spreadsheet programs include common functions that can be used for quickly finding the sum, average, count, maximum value, and minimum value for a range of cells. In order to use functions correctly, you'll need to understand the different parts of a function and how to create arguments to calculate values and cell references.

6 0
3 years ago
Other questions:
  • Suppose we are comparing implementations of insertion sort and merge sort on the same machine. for inputs of size n, insertion s
    10·1 answer
  • in access, entering the search criteria "B?" would yield which of the following results? a. bentonville b. be c. brimingham d. b
    14·1 answer
  • Can someone tell me how to use the Human machine language for beginners? or websites I should use.​
    7·1 answer
  • 1. Write a recursive method to determine if a character is in a list of characters in O(logN) time. Mathematically prove (as we
    13·1 answer
  • Green Field county stadium is planning to conduct a cricket match between two teams A and B. A large crowd is expected in the st
    6·1 answer
  • You would like to narrow your search on this topic.
    15·2 answers
  • Would you prefer to use an integrated router, switch, and firewall configuration for a home network, or would you prefer to oper
    5·1 answer
  • A company's desire to sell products and services: A. will ultimately lead to its doom. B. explains why the web took off C. can d
    9·2 answers
  • What one main difference between social media and traditional media such as television?
    12·2 answers
  • You're asked to recommend potential data structures to use as the backing for implementing Kruskal's algorithm. Which of the fol
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!