-11
namespace Computerization_of_Health_Records
{
public class HealthProfile
{
//auto implemented property Firstname implicitly creates an
//instance variable for the patients first name
public string FirstName { get; set; }
//auto implemented property Firstname implicitly creates an
//instance variable for the patients last name
public string LastName { get; set; }
//auto implemented property Gender implicitly creates an
//instance variable for the patients gender
public string Gender { get; set; }
//auto implemented property birthday implicitly creates an
//instance variable for the patients birth day
public Int32 Birthday { get; set; }
//auto implemented property height implicitly creates an
//instance variable for the patients height
public string Height { get; set; }
//auto implemented property weight implicitly creates an
//instance variable for the patients weight
public string Weight { get; set; }
public string maxHeartRate { get; set; }
public string bmi { get; set; }
public string Age { get; set; }
//constructor to initialize first name, last name, gender, birthday, birth month,
//Birth year, height and weight.
public HealthProfile(string first, string last, string gender, Int32 birthday, string height, string weight, string maxHrtRate)
{
FirstName = first;
LastName = last;
Gender = gender;
Birthday = birthday;
Height = height;
Weight = weight;
maxHeartRate = maxHrtRate;
}
}
}
什么是“TIA”?为什么这么多代码与问题无关? – tadman
问题中的任何代码与计算出生日期有什么关系? – Amy
您的生日变量是Int32。除非它至少是时间跨度值,否则您将无法计算年龄。 – Amit