I need help to create a program that can show the hierarchy of any Atoms and its components (neutrons,protons,electrons,and chemical reaction)
Here is a code of what i have done so far,being a novice at the subject
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Atoms
{
public class Atoms
{
protected string name = "Sodium";
protected string element ="Metal";
public virtual void GetInfo()
{
Console.WriteLine("name: {0}",name);
Console.WriteLine("element: {0}", element);
}
}
class Proton : Atoms
{
public int number = 11 ;
public override void GetInfo()
{
base.GetInfo();
Console.WriteLine("Proton number: {0}",number);
}
}
class Electron : Atoms
{
public int number = 11;
public override void GetInfo()
{
base.GetInfo();
Console.WriteLine("Electron number: {0}", number);
}
class Neutrons : Atoms
{
public int number = 12;
public override void GetInfo()
{
base.GetInfo();
Console.WriteLine("Neutron number: {0}", number);
}
class TestClass
{
static void Main()
{
Proton P = new Proton();
P.GetInfo();
Neutrons N = new Neutrons();
N.GetInfo();
Electron E = new Electron();
E.GetInfo();
Console.WriteLine("click any key to exit");
Console.ReadLine();
}
}
}
}
}