Skip to content

Introduction of Solar System planets using Indexers (C# 6.0)

Notifications You must be signed in to change notification settings

LusineHovs/SolarSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SolarSystem

Introduction of Solar System planets using Indexers (C# 6.0, .Net Framework 4.6, Microsoft Visual Studio)

In the documents you can find StarSystem abstract class with the following fields.

protected string systemName { get; set; }
protected int planetsNumber { get; set; }
protected string[] planetsName { get; set; }

And you can find SolarSystem concrete class which is the implementation of StarSystem. By using Indexers I set indexes to planets' name.

public string this[int index]
{
 get
     {
       if (index < 0 && index > planetsNumber)
          throw new IndexOutOfRangeException();
       return planetsName[index];
     }
 set
     {
        planetsName[index] = value;
     }
 }

In Testing folder is executable program, outputs of execution are following

Outputs

       

About

Introduction of Solar System planets using Indexers (C# 6.0)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages