using System;
namespace oop4
{
class Person
{
static void Main(string[] args)
{
human obj = new human();
obj.Name="Bill";
human.Inner obj2 = new human.Inner(5,8,60);
Console.WriteLine(obj2.Status());
Console.ReadKey();
}
}
class human
{
string name;
public string Name { set { name = value; } get { return name; } }
public class Inner
{
string healthstatus;
int heightinfoot = 0;
int heightininches = 0;
int weight = 0;
public Inner(int hf,int hi,int w)
{
heightinfoot = hf;
heightininches = hi;
weight = w;
}
public string Status()
{
if (heightinfoot == 4 && heightininches == 6)
{
if (weight >= 25 && weight <= 35)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 4 && heightininches == 7)
{
if (weight >= 30 && weight <= 39)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 4 && heightininches == 8)
{
if (weight >= 33 && weight <= 40)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 4 && heightininches == 9)
{
if (weight >= 35 && weight <= 44)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 4 && heightininches == 10)
{
if (weight >= 38 && weight <= 46)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 4 && heightininches == 11)
{
if (weight >= 40 && weight <= 50)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 0)
{
if (weight >= 43 && weight <= 53)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 1)
{
if (weight >= 45 && weight <= 55)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 2)
{
if (weight >= 48 && weight <= 59)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 3)
{
if (weight >= 50 && weight <= 61)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 4)
{
if (weight >= 53 && weight <= 65)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 5)
{
if (weight >= 55 && weight <= 68)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 6)
{
if (weight >= 58 && weight <= 70)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 7)
{
if (weight >= 60 && weight <= 74)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 8)
{
if (weight >= 63 && weight <= 76)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 9)
{
if (weight >= 65 && weight <= 80)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 10)
{
if (weight >= 67 && weight <= 83)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 11)
{
if (weight >= 70 && weight <= 85)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 6 && heightininches == 0)
{
if (weight >= 72 && weight <= 89)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
return healthstatus;
}
}
}
}
namespace oop4
{
class Person
{
static void Main(string[] args)
{
human obj = new human();
obj.Name="Bill";
human.Inner obj2 = new human.Inner(5,8,60);
Console.WriteLine(obj2.Status());
Console.ReadKey();
}
}
class human
{
string name;
public string Name { set { name = value; } get { return name; } }
public class Inner
{
string healthstatus;
int heightinfoot = 0;
int heightininches = 0;
int weight = 0;
public Inner(int hf,int hi,int w)
{
heightinfoot = hf;
heightininches = hi;
weight = w;
}
public string Status()
{
if (heightinfoot == 4 && heightininches == 6)
{
if (weight >= 25 && weight <= 35)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 4 && heightininches == 7)
{
if (weight >= 30 && weight <= 39)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 4 && heightininches == 8)
{
if (weight >= 33 && weight <= 40)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 4 && heightininches == 9)
{
if (weight >= 35 && weight <= 44)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 4 && heightininches == 10)
{
if (weight >= 38 && weight <= 46)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 4 && heightininches == 11)
{
if (weight >= 40 && weight <= 50)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 0)
{
if (weight >= 43 && weight <= 53)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 1)
{
if (weight >= 45 && weight <= 55)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 2)
{
if (weight >= 48 && weight <= 59)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 3)
{
if (weight >= 50 && weight <= 61)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 4)
{
if (weight >= 53 && weight <= 65)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 5)
{
if (weight >= 55 && weight <= 68)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 6)
{
if (weight >= 58 && weight <= 70)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 7)
{
if (weight >= 60 && weight <= 74)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 8)
{
if (weight >= 63 && weight <= 76)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 9)
{
if (weight >= 65 && weight <= 80)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 10)
{
if (weight >= 67 && weight <= 83)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 5 && heightininches == 11)
{
if (weight >= 70 && weight <= 85)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
if (heightinfoot == 6 && heightininches == 0)
{
if (weight >= 72 && weight <= 89)
{
healthstatus = "healthy";
}
else
{
healthstatus = "not healthy";
}
}
return healthstatus;
}
}
}
}
Comments
Post a Comment