-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