Access Millions of academic & study documents

please help with this questionSolutionAnswerclass Arro

Content type
User Generated
Showing Page:
1/3
please help with this question
Solution
//Answer:
class Arrow {
double velocity;
double angle;
/*Answer A */
public Arrow() {
velocity = 20;
angle = 10;
}
/*Answer B */
public Arrow(double vel, double ang) {
velocity = vel;
angle = ang;
}
/*Answer C */
public void setVelocity(double vel) {
velocity = vel;

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/3
}
/*Answer E */
/**
* A method to set the value of angle
* @param ang
*/
public void setAngle(double ang) {
angle = ang;
}
public double getVelocity() {
return velocity;
}
public double getAngle() {
return angle;
}
/*Answer D */
public double getHeight() {
double g = 9.8;
double Height = Math.pow(velocity, 2) *
Math.pow((Math.sin(angle)), 2) / (2 * g);
return Height;
}
}

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/3

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
please help with this question Solution //Answer: class Arrow { double velocity; double angle; /*Answer A */ public Arrow() { velocity = 20; angle = 10; } /*Answer B */ public Arrow(double vel, double ang) { velocity = vel; angle = ang; } /*Answer C */ public void setVelocity(double vel) { velocity = vel; } /*Answer E */ /** * A method to set the value of angle * @param ang */ public void setAngle(double ang ) { angle = ang; } public double getVelocity() { return velocity; } public double getAngle() { return angle; } /*Answer D */ public double getHeight() { double g = 9.8; double Height = Math.pow(velocity, 2) * Math.pow((Math.sin(angle)), 2) / (2 * g); return Height; } } Name: Description: ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4