csharp beginner
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace csharp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hallo Welt");
int x;
Console.WriteLine("#######MENU########");
Console.WriteLine("1-while loop");
Console.WriteLine("2-if else statement");
Console.WriteLine("3-switch statement");
Console.WriteLine("please choose one of them.....");
x=int.Parse(Console.ReadLine());
switch (x)
{
case 1:
Console.WriteLine("result= result + (your num)/2");
Console.Write("enter a nummer biger than 10 : ");
int add = int.Parse(Console.ReadLine());
int result = 0;
while (add / 2>0)
{
result = result + add;
add /= 2;
}
Console.WriteLine("the result is: {0}", result);
break;
case 2:
Console.WriteLine("this program gives you information about your pulse");
Console.WriteLine("enter your pulse");
int pulse = int.Parse(Console.ReadLine());
if (pulse >= 60 && pulse <= 100)
{
Console.WriteLine("it is only normal for mature");
}
else if (pulse > 100 && pulse <= 120)
{
Console.WriteLine("it is only normal for kid");
}
else if (pulse > 120 && pulse <= 140)
{
Console.WriteLine("it is only normal for baby");
}
else
{
Console.WriteLine("it is not normal!");
}
break;
case 3:
Console.WriteLine("this program gives you information about languages");
Console.WriteLine("greetings of nationalites");
Console.WriteLine("#######GREETINGS########");
Console.WriteLine("1-Hallo!");
Console.WriteLine("2-Hi!");
Console.WriteLine("3-Merhaba!");
Console.WriteLine("4-Ciao!");
Console.WriteLine("5-Salut!");
Console.WriteLine("choose one of them: ");
int choose = int.Parse(Console.ReadLine());
switch (choose)
{
case 1:
Console.WriteLine("it is GERMAN");
break;
case 2:
Console.WriteLine("it is ENGLISH");
break;
case 3:
Console.WriteLine("it is TURKISH");
break;
case 4:
Console.WriteLine("it is ITALIAN");
break;
case 5:
Console.WriteLine("it is FRENCH");
break;
default:
Console.WriteLine("typing error");
break;
}
break;
default:
Console.WriteLine("choosing error");
break;
}
}
}
}