Which of the following is a correct definition for a Rectangle class in Java?
A. public Rectangle class {
double length;
double width;
public double getArea() {
return length * width;
}
public double getPerimeter() {
return 2 * (length+width);
}
}
B. public Rectangle class {
double length;
double width;
public getArea():double {
return length * width;
}
public getPerimeter():double {
return 2 * (length+width);
}
}
C. public class Rectangle {
double length;
double width;
public double getArea() {
return length * width;
}
public double getPerimeter() {
return 2 * (length+width);
}
}
D. public class Rectangle {
double length;
double width;
public getArea():double {
return length * width;
}
public getPerimeter(): double {
return 2 * (length+width);
}
}
Answer: C
You might also like to view...
The ____ is information that is used to determine whether data was corrupted during transmission.
A. LLC B. CRC C. MAC D. RPC
What does a service ticket (ST) provide in Kerberos authentication?
A. It serves as the authentication host. B. It provides proof that the subject is authorized to access an object. C. It provides proof that a subject has authenticated through a KDC and can request tickets to access other objects. D. It provides ticket granting services.
What is the effect of the following code fragment?
``` int num1 = 2; int num2; cin >> num2; if ( num2 % num1 == 0 ) cout << "first option" << endl; else cout << "second option" << endl; ``` a. assigns the character "%" to the variable num2 if num1 is 0, and displays first option b. displays first option if num1 and num2 are equal to 0, and second option otherwise c. displays first option if an even number is entered as input, and second option if an odd number is entered as input d. displays first option if num1 and num2 are equal and second option otherwise
Using a computer to forecast future sales and order more inventory before a shortage can occur is an example of information system feedback.
Answer the following statement true (T) or false (F)