How to do it...

  1. Create a new class called LaunchSuttle. Then, add the following private variables to the class for engine thrust, the mass of the shuttle, the local gravitational acceleration, the constant values for the gravity of the Earth, Moon, and Mars (these are constants because they will never change), the universal gravitational constant, and an enumerator for the planet we are dealing with:
        public class LaunchShuttle         {           private double _EngineThrust;           private double _TotalShuttleMass;           private double _LocalGravitationalAcceleration;           private const double EarthGravity = 9.81;           private const double MoonGravity = 1.63;           private const double MarsGravity = 3.75;           private double UniversalGravitationalConstant;  public enum Planet { ...

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.