Answer:
The code for this class is shown in the explanation section
Explanation:
public class Circle {
private double radius;
private double diameter;
private double area;
public Circle(double radius, double diameter, double area) {
this.radius = 1;
this.diameter = diameter;
this.area = area;
}
public void setRadius(double radius) {
this.radius = radius;
diameter = radius*2;
area= Math.PI*(radius*radius);
}
public double getRadius() {
return radius;
}
}
Answer:
C. E-mail
Explanation:
Electronic mail is the best choice to convey urgent and highly sensitive information
Answer:
<em>C++</em>
///////////////////////////////////////////////////////////////////////////////////////////
#include <iostream>
using namespace std;
//////////////////////////////////////////////////////////////////
class QuadraticEquation {
int a, b, c;
public:
QuadraticEquation(int a, int b, int c) {
this->a = a;
this->b = b;
this->c = c;
}
////////////////////////////////////////
int getA() {
return a;
}
int getB() {
return b;
}
int getC() {
return c;
}
////////////////////////////////////////
// returns the discriminant, which is b2-4ac
int getDiscriminant() {
return (b*2)-(4*a*c);
}
int getRoot1() {
if (getDiscriminant() < 0)
return 0;
else {
// Please specify how to calculate the two roots.
return 1;
}
}
int getRoot2() {
if (getDiscriminant() < 0)
return 0;
else {
// Please specify how to calculate the two roots.
return -1;
}
}
};
//////////////////////////////////////////////////////////////////
int main() {
return 0;
}
Answer:
Trap is a software interrupt that occurs when there is a system call, while hardware interrupt occurs when a hardware component needs urgent attention.
Explanation:
Interrupt is an input signal that disrupt the activities of a computer system, giving immediate attention to a hardware or software request.
In trap interrupt, the system activities are stop for a routine kernel mode operation, since it has a higher priority than the user mode. At the end of the interrupt, it switches control to the user mode.
The hardware interrupt is a signal from hardware devices like the input/output devices, storage and even peripheral devices that draws an immediate attention of the processor, stopping and saving other activities and executing the event with an interrupt handler.