Thursday, June 9, 2016

C# Main Function for Calling all classes


 void Main_Fun()
{
int num;
Program obj = new Program();
Console.Clear();
Console.ForegroundColor = ConsoleColor.Green;
Console.BackgroundColor = ConsoleColor.DarkCyan;
Console.WriteLine("\n\t\t\t*****VISUAL PROGRAMMING*****");
Console.WriteLine("\n\t\t\t ****ASSIGNMENT # 1****\n\n");
Console.Write("\nIf Run Project (Y/N) ? ");
obj.choice = Convert.ToChar(Console.ReadLine());
if (obj.choice != 'Y' && obj.choice != 'y')
{
Console.WriteLine("\nSee you Next Time");
}
else
{
Console.Write("\nEnter the Question No. : ");
num = Convert.ToInt32(Console.ReadLine());
switch (num)
{
case 1:
obj.Question_1();
break;
case 2:
obj.Question_2();
break;
case 3:
obj.Question_3();
break;
case 4:
obj.Question_4();
break;
case 5:
obj.Question_5();
break;
case 6:
obj.Question_6();
break;
case 7:
obj.Question_7();
break;
case 8:
obj.Question_8();
break;
case 9:
obj.Question_9();
break;
case 10:
obj.Question_10();
break;
case 11:
obj.Question_11();
break;
case 12:
obj.Question_12();
break;
case 13:
obj.Question_13();
break;
case 14:
obj.Question_14();
break;
case 15:
obj.Question_15();
break;
case 16:
obj.Question_16();
break;
case 17:
obj.Question_17();
break;
case 18:
obj.Question_18();
break;
case 19:
obj.Question_19();
break;
case 20:
obj.Question_20();
break;
case 21:
obj.Question_21();
break;
case 22:
obj.Question_22();
break;
case 23:
obj.Question_23();
break;
case 24:
obj.Question_24();
break;
case 25:
obj.Question_25();
break;
case 26:
obj.Question_26();
break;
case 27:
obj.Question_27();
break;
case 28:
obj.Question_28();
break;
case 29:
obj.Question_29();
break;
case 30:
obj.Question_30();
break;
case 31:
obj.Question_31();
break;
case 32:
obj.Question_32();
break;
case 33:
obj.Question_33();
break;
case 34:
obj.Question_34();
break;
case 35:
obj.Question_35();
break;
case 36:
obj.Question_36();
break;
case 37:
obj.QUestion_37();
break;
case 38:
obj.Question_38();
break;
case 39:
obj.Question_39();
break;
case 40:
obj.Question_40();
break;
case 41:
obj.Question_41();
break;
case 42:
obj.Question_42();
break;
case 43:
obj.Question_43();
break;
case 44:
obj.Question_44();
break;
case 45:
obj.Question_45();
break;
default:
Console.WriteLine("\nInvalid Program Number Try Again");
break;
}
}
}