Exercise 3-11. Turn the AllTheColorsOfTheRainbow example into a program that compiles and runs.
public class AllTheColorsOfTheRainbow // PascalCase
{
int anIntegerRepresentingColors; // CamelCase
void changeTheHueOfTheColor(int newHue)
{
anIntegerRepresentingColors = newHue;
}
public static void Main()
{
AllTheColorsOfTheRainbow all = new AllTheColorsOfTheRainbow();
System.Console.WriteLine(all.anIntegerRepresentingColors);
all.changeTheHueOfTheColor(1);
System.Console.WriteLine(all.anIntegerRepresentingColors);
}
}
/*
mcs AllTheColorsOfTheRainbow.cs
mono AllTheColorsOfTheRainbow.exe
0
1
*/