Answer:
i just got to this question but the answers are
Explanation:
4
3
1
2
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.
Answer:
B repeat a chunk of code until the condition is true im 88% sure
Answer:
Check the explanation
Explanation:
#include <bits/stdc++.h>
using namespace std;
class Rectangle{
public:
int length;
int breadth;
Rectangle(int l,int b){
length = l;
breadth = b;
}
int area(){
return length*breadth;
}
int perimeter(){
return 2*(length+breadth);
}
bool equals(Rectangle* r){
// They have the exact same length and width.
if (r->length == length && r->breadth == breadth)
return true;
// They have the same area
if (r->area() == area())
return true;
// They have the same perimeter
if (r->perimeter() == perimeter())
return true;
// They have the same shape-that is, they are similar.
if (r->length/length == r->breadth/breadth)
return true;
return false;
}
};
int main(){
Rectangle *r_1 = new Rectangle(6,3);
Rectangle *r_2 = new Rectangle(3,6);
cout << r_1->equals(r_2) << endl;
return 0;
}