Decided to write this part tonight as i wont be able to release another Part for a few days.
*Please also note, most code in this series will be written as im writing the thread, its unlikely but if by some chance i do mess up in the code, please leave a comment below. Remember this series is targeted for beginners, there may be points in the series where i could of coded something more efficiently, however im trying to make it easy for a noob to understand!!*
In this part you SHOULD learn how switch statements work and how you can use them!
Of course you can have more Case's look below for another example;
To all readers, i spend time to write this so if you do go to publish my code on another forum, please credit or just write the thing yourself!
Need Any Help? Skype- FourSeasonModz
*Please also note, most code in this series will be written as im writing the thread, its unlikely but if by some chance i do mess up in the code, please leave a comment below. Remember this series is targeted for beginners, there may be points in the series where i could of coded something more efficiently, however im trying to make it easy for a noob to understand!!*
In this part you SHOULD learn how switch statements work and how you can use them!
PHP:
static void Main(string[] args)
{
Console.Write("Rate Syndicate Out Of 10!!");
int marks = int.Parse(Console.ReadLine());
switch (marks)
{
case 10: // if 10 is entered, execute next code!
Console.Write("Thank You");
break; // if conditions arent met, break | jump to next
default: // if all is false and a valid value hasent been entered
Console.Write("Your a **** bruhhh");
break;
}
Console.Read();
}
}
}
Of course you can have more Case's look below for another example;
PHP:
static void Main(string[] args)
{
Console.Write("Please Type A Number!");
int marks = int.Parse(Console.ReadLine());
switch (marks)
{
case 10: // if 10 is entered, execute next code!
Console.Write("You Typed 10!");
break; // if conditions arent met, break | jump to next
case 9: // if 9 is entered, execute next code!
Console.Write("You Typed 9");
break; // if conditions arent met, break | jump to next
case 8: // if 8 is entered, execute next code!
Console.Write("You Typed 8");
break; // if conditions arent met, break | jump to next
default: // if all is false and a valid value hasent been entered
Console.Write("You didnt type 10, 9 or 8");
break;
}
Console.Read();
}
To all readers, i spend time to write this so if you do go to publish my code on another forum, please credit or just write the thing yourself!
Need Any Help? Skype- FourSeasonModz