imports microsoft.visualbasic
Console.ForegroundColor = 15
Dim ColourChoise1 As String = 0
Dim ColourChoise2 As String = 0
Console.WriteLine("This program can print out some shapes with different colours.")
Console.WriteLine("Menu")
Console.WriteLine("1 Square")
Console.WriteLine("2 Triangle")
Console.WriteLine("3 Circle")
Console.WriteLine("99 Exit Program")
Console.ForegroundColor = ConsoleColor.White
Console.BackgroundColor = ConsoleColor.Black
Console.WriteLine("Enter Choise")
Choise = Console.ReadLine()
Console.WriteLine("Exiting Program, press any button to finish...")
Console.WriteLine("Invalid Entry.")
If Choise = 1 Or Choise = 2 Or Choise = 3 Then
Console.WriteLine("Choose a text colour (R-O-Y-G-B-V). No input assumes white.")
ColourChoise1 = Console.ReadLine
ColourChoise1 = StrToColour(ColourChoise1)
If ColourChoise1 = -1 Then
Console.WriteLine("Black text has been chosen")
If Choise = 1 Or Choise = 2 Or Choise = 3 Then
Console.WriteLine("Choose a highlight colour (R-O-Y-G-B-V). No input assumes black.")
ColourChoise2 = Console.ReadLine
ColourChoise2 = StrToColour(ColourChoise2)
If ColourChoise2 = -1 Then
Console.WriteLine("Black highlight has been chosen")
MyShape.SetShapeName(IntToShape(Choise))
MyShape.SetForegroundColour(ColourChoise1)
MyShape.SetBackgroundColour(ColourChoise2)
If Choise = 1 Or Choise = 2 Or Choise = 3 Then
Private BackgroundColour As Integer
Private ForegroundColour As Integer
Private ShapeName As String
Public Sub SetShapeName(n As String)
Public Function GetShapeName() As String
Public Sub SetBackgroundColour(b As Integer)
Console.BackgroundColor = BackgroundColour
Public Sub SetForegroundColour(f As Integer)
Console.ForegroundColor = ForegroundColour
Public Overridable Sub Draw()
Console.WriteLine("Drawing a {0} {1} with a {2} highlight", ColourToStr(ForegroundColour), ShapeName, ColourToStr(BackgroundColour))
Public Overrides Sub Draw()
Console.WriteLine("##########")
Console.WriteLine("##########")
Public Overrides Sub Draw()
Console.WriteLine(" # # ")
Console.WriteLine(" # # ")
Console.WriteLine(" # # ")
Console.WriteLine("# # ")
Console.WriteLine("##########")
Public Overrides Sub Draw()
Console.WriteLine(" #### ")
Console.WriteLine(" ## ## ")
Console.WriteLine(" ## ## ")
Console.WriteLine(" #### ")
Public Function IntToShape(n As Integer) As String
Public Function StrToColour(n As String) As Integer
Public Function ColourToStr(n As Integer) As String