Advertisement
Guest User

Code?

a guest
Apr 1st, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.26 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace PlanetLibrary
  7. {
  8.     public class Planet : PlanetMaths
  9.     {
  10.  
  11.         //Variables
  12.         double Radius = 0;
  13.         double Surface = 0;
  14.         double Atmosphere = 0;
  15.         double Speed = 0;
  16.         double DistanceQ = 0;
  17.         double Mass = 0;
  18.         double Weight = 0;
  19.         int YearInDays = 0;
  20.         int Time = 0;
  21.         double Circle = 0;
  22.         string stringHolder = "";
  23.         double ans = 0;
  24.  
  25.         public Planet()
  26.         {
  27.         }
  28.  
  29.         public void setRadius(double PlanetRadius)
  30.         {
  31.             Radius = PlanetRadius;
  32.         }
  33.  
  34.         public double getRadius()
  35.         {
  36.             return Radius;
  37.         }
  38.  
  39.         public void setSurface(double PlanetSurface)
  40.         {
  41.             Surface = PlanetSurface;
  42.         }
  43.  
  44.         public double getSurface()
  45.         {
  46.             return Surface;
  47.         }
  48.  
  49.         public void setAtmosphere(double PlanetAtmosphere)
  50.         {
  51.             Atmosphere = PlanetAtmosphere;
  52.         }
  53.  
  54.         public double getAtmospehere()
  55.         {
  56.             return Atmosphere;
  57.         }
  58.  
  59.         public void setSpeed(double PlanetSpeed)
  60.         {
  61.             Speed = PlanetSpeed;
  62.         }
  63.  
  64.         public double getSpeed()
  65.         {
  66.             return Speed;
  67.         }
  68.  
  69.         public void setDistance(double PlanetDistance)
  70.         {
  71.             DistanceQ = PlanetDistance;
  72.         }
  73.  
  74.         public double getDistance()
  75.         {
  76.             return DistanceQ;
  77.         }
  78.  
  79.         public void setMass(double Mass)
  80.         {
  81.             Weight = Mass;
  82.         }
  83.  
  84.         public double getMass()
  85.         {
  86.             return Mass;
  87.         }
  88.  
  89.         public void setYearInDays(int YearInDays)
  90.         {
  91.             Time = YearInDays;
  92.         }
  93.  
  94.         public double getYearInDays()
  95.         {
  96.             return YearInDays;
  97.         }
  98.  
  99.     }
  100.  
  101.     public class PlanetMaths : GeneralMaths
  102.     {
  103.  
  104.         public PlanetMaths()
  105.         {
  106.  
  107.         }
  108.  
  109.         public static string PlanetMass(string surfaceType, double radius)
  110.         {
  111.             string stringHolder;
  112.             double answer;
  113.             if(surfaceType == "Rock")
  114.             {
  115.                 answer =  * 2002.00;
  116.             }
  117.  
  118.             else if (surfaceType == "Gas")
  119.             {
  120.  
  121.             }
  122.             else
  123.             {
  124.  
  125.             }
  126.  
  127.         }
  128.     }
  129.  
  130.     public class GeneralMaths
  131.     {
  132.  
  133.         public GeneralMaths()
  134.         {
  135.  
  136.         }
  137.  
  138.         public double Volume (double radius)
  139.         {
  140.             double answer;
  141.             answer = (4 / 3) * (Math.PI) * (radius * radius * radius);
  142.             return answer;
  143.         }
  144.  
  145.         public double Distance(double radius)
  146.         {
  147.             double answer;
  148.             answer = 2 * (Math.PI) * radius;
  149.             return answer;
  150.         }
  151.     }
  152.  
  153.  //  class Display
  154.  //  {
  155.  //
  156.  //      Console.WriteLine("|-------------------------------|");
  157.  //      Console.WriteLine("|      Planet Calculator        |");
  158.  //      Console.WriteLine("|-------------------------------|");
  159.  //      Console.WriteLine("");
  160.  //      Console.WriteLine("|-------------------------------|");
  161.  //  }
  162.  
  163. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement