A satellite is a moon, planet or machine that orbits a planet or
star. In this exercise, you will create an class that represents a
satellite, and using this class create a series of Satellite object
instances.
Satellites have the following attributes/characteristics:
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:
<<GIVEN CODE>>
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 name;
}
/**
* 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;
}
}
A satellite is a moon, planet or machine that orbits a planet or star. In this exercise, you will create an class that r
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am