Satellites have the following attributes/characteristics: • A name (String) • A height in kilometres above the centre of
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Satellites have the following attributes/characteristics: • A name (String) • A height in kilometres above the centre of
package satellite;
public class Satellite {
/**
* Constructor for Satellite
* @param name
* @param height
* @param velocity
*/
public Satellite(String name, int height, double position,
double velocity) {}
/**
* Getter for name
*/
public String getName() {
return 0;
}
/**
* Getter for height
*/
public int getHeight() {
return 0;
}
/**
* Getter for position (degrees)
*/
public double getPositionDegrees() {
return 0;
}
/**
* Getter for position (radians)
*/
public double getPositionRadians() {
return 0;
}
/**
* Returns the linear velocity (metres per second) of the
satellite
*/
public double getLinearVelocity() {
return 0;
}
/**
* Returns the angular velocity (radians per second) of the
satellite
*/
public double getAngularVelocity() {
return 0;
}
/**
* Setter for name
* @param name
*/
public void setName(String name) {}
/**
* Setter for height
* @param height
*/
public void setHeight(int height) {}
/**
* Setter for velocity
* @param velocity
*/
public void setVelocity(double velocity) {}
/**
* Setter for position
* @param position
*/
public void setPosition(double position) {}
/**
* Calculates the distance travelled by the satellite in the
given time
* @param time (seconds)
* @return distance in metres
*/
public double distance(double time) {
return 0;
}
}
Satellites have the following attributes/characteristics: • A name (String) • A height in kilometres above the centre of the earth (integer) • A velocity in metres per second (double) • A position, which is an angle in degrees of the satellite relative to the x-axis, anticlockwise. • All of the above attributes can be retrieved using a getter function and set using a setter function • The position of the satellite can be retrieved in radians as well as degrees • The angular velocity of the satellite, (radians per second) can be found as well as the linear velocity (metres per second) • Given a length of time in seconds, the distance the satellite has travelled can be found. You have been given a series of function definitions inside src/satellite/Satellite.java. Implement these functions according to the docstrings and above requirements. Once you have done this, write a main method that does the following: • Creates Satellite A, which is 10000 km above the centre of the earth, with a velocity of 55 metres per second and at e = 122. • Creates Satellite B, which is 5438 km above the centre of the earth, with a velocity of 234 kilometres per second and at 0 = 0. • Creates Satellite C, which is 9029 km above the centre of the earth, with a velocity of 0 metres per second and at e = 284. • For Satellite A, print out I am {name} at position {theta} degrees, {height} km above the centre of the earth and moving at a velocity of {velocity} metres per second Change Satellite A's height to 9999 Change Satellite B's angle to 45 Change Satellite C's velocity to 36.5 mps • Print out Satellite A's position in radians Print out Satellite B's angular velocity • Print out the distance Satellite C travels after 2 minutes.