mrHazan eto yung code ko pa check naman
class Program
{
struct inkColor
{
public string inkInfo;
public int inkContent;
}
static void Main(string[] args)
{
inkColor color1;
color1.inkInfo = "Black";
color1.inkContent = 20;
Console.WriteLine("1.Display Info");
Console.WriteLine("2.Change Color");
Console.WriteLine("3.Refill");
Console.WriteLine("4.Write");
Console.WriteLine("");
userIn:
Console.Write("Enter your choice: ");
int userIn = int.Parse(Console.ReadLine());
Console.WriteLine("");
switch (userIn)
{
case 1:
Console.WriteLine("Result:");
Console.WriteLine("Ink Color > " + color1.inkInfo);
Console.WriteLine("Ink Content > " + color1.inkContent);
goto userIn;
break;
case 2:
//int inkContent = 20;
if (inkContent > 0)
{
Console.WriteLine(color1.inkInfo);
}
else
{
Console.WriteLine("Refill first");
}
Console.WriteLine("Change your color now!");
color1.inkInfo = Console.ReadLine();
goto userIn;
break;
case 3:
int a = 20;
if (a > 0)
{
color1.inkContent = +10;
Console.WriteLine("Sorry the maximum of inkContent is 20.");
}
Console.WriteLine("* Refill Successful! *");
goto userIn;
break;
case 4:
Console.WriteLine("* The Ink Content has been Deducted by 10!.* ");
color1.inkContent -= 10;
goto userIn;
break;
}
}
}
}