If
if {}else{}
if{}elseif{}else{} =if{}else{}if{}else{}
Double equals sign inside if bracket
Standard weight test:
Console.Write ("Please enter your name:");
string s = Console.ReadLine ();
Console.Write ("Please enter your gender:");
String a = Console.ReadLine ();
Console.Write ("Please enter your weight:");
int d = Int. Parse (Console.ReadLine ());
Console.Write ("Please enter your height:");
int c = Int. Parse (Console.ReadLine ());
if (a = = "male")
{
int q = d-c + 100;
if (q >=-3 && q <= 3)
{
Console.Write ("You are the standard weight");
}
else if (Q > 3)
{
Console.Write ("You are overweight, it's time to lose weight");
}
else if (Q <-3)
{
Console.Write ("Your weight is thin, it's time to fatten up");
}
}
Else
{
int q = d-c + 100;
if (q >=-3 && q <= 3)
{
Console.Write ("You are the standard weight");
}
else if (Q > 3)
{
Console.Write ("You are overweight, it's time to lose weight");
}
else if (Q <-3)
{
Console.Write ("Your weight is thin, it's time to fatten up");
}
Console.ReadLine ();
}
}
}
}
Application of Learning Summary condition statement