C# 7 and .NET Core Cookbook
上QQ阅读APP看书,第一时间看更新

Getting ready

To illustrate the concept of encapsulation, we will create a class that is somewhat complex in its inner working. We need to calculate the thrust-to-weight ratio (TWR) of a space shuttle to determine whether it will be able to take off vertically. It needs to exert more thrust than its weight to counteract gravity and get into a stable orbit. This also depends on which planet the shuttle takes off, because different planets exert different gravitational forces on objects on their surface. In simple terms, the TWR must be greater than one.