change the main class so that the user is the one that as to put the name Write a driver class (app) that prompts for the person’s data input, instantiates an object of class HeartRates and displays the patient’s information from that object by calling the DisplayPatientRecord, method.
Please help with the following: C# .NET
change the main class so that the user is the one that as to put the name Write a driver class (app) that prompts for the person’s data input, instantiates an object of class HeartRates and displays the patient’s information from that object by calling the DisplayPatientRecord, method.
MAIN CLASS----------------------
static void Main(string[] args) { // instance of patient record with each of the 4 parameters taking in a value HeartRates heartRate = new HeartRates("James", "Kill", 1988, 2021); heartRate.DisplayPatientRecord(); // call the method to display The Patient Record }
CLASS HeartRATES-------------------
class HeartRates { //class attributes private private string _First_Name; private string _Last_Name; private int _Birth_Year; private int _Current_Year; // Constructor which receives private parameters to initialize variables public HeartRates(string First_Name, string Last_Name, int Birth_Year, int Current_Year) { _First_Name = First_Name; _Last_Name = Last_Name; _Birth_Year = Birth_Year; _Current_Year = Current_Year; } // Auto-Implemented mutators and accessor public string First_Name { get; set; } public string Last_Name { get; set; } public int Birth_Year { get; set; } public int Current_Year { get; set; } // method/property to calculate the person age public int Person_Age { get { return _Current_Year - _Birth_Year; } } // method/property to calculate the person Max Heart Rate public int Max_Heart_Rate { get { return 220 - Person_Age; } } //method/ property to calculate the person Minimum target heart rate public double Min_Target_Heart_Rate { get { return Max_Heart_Rate * 0.65; } } // method / property to calculate the person Maximum target heart rate public double Max_Target_Heart_Rate { get { return Max_Heart_Rate * 0.75; } } // print method to which holds formatted patient record public void DisplayPatientRecord() { Console.WriteLine($"|--------------------------------------------------------|"); Console.WriteLine($"| Patient Heart Rate Record |"); Console.WriteLine($"|--------------------------------------------------------|"); Console.WriteLine($"| {"Employee Name",-21} | {_Last_Name + ", " + _First_Name,-30} |"); Console.WriteLine($"| {"Patient Birth Year",-21} | {_Birth_Year,30:D} |"); Console.WriteLine($"| {"Patient Age:",-21} | {Person_Age,30:D} |"); Console.WriteLine($"| {"Maximum Heart Rate",-21} | {Max_Heart_Rate,30:F} |"); Console.WriteLine($"| {"Target Heart Rate",-21} | {(Min_Target_Heart_Rate + "-" + Max_Target_Heart_Rate),31:F}|"); Console.WriteLine($"|--------------------------------------------------------|"); } } }
![](/static/compass_v2/shared-icons/check-mark.png)
using System;
class HealthProfile {
public string FirstName;
public string LastName;
public int BirthYear;
public int Height;
public int weight;
public int currentYear;
public HealthProfile(){ //Constructor of HealthProfile Class
FirstName="aman";
LastName="kumar";
BirthYear=1971;
Height=70;
weight=200;
currentYear=2021;
}
public int person_age() //Calculate age with current year and birth year
{
int age=0;
age=currentYear-BirthYear;
return age;
}
public string BMI_calculate(){
float bmi;
bmi=(weight*703)/(Height*Height);
if(bmi<18.5){
return "UnderWeight";
}
else if(bmi>18.4 && bmi<24.9){
return "Normal";
}else if(bmi>25.0 && bmi<29.9 ){
return "OverWeight";
}else{
return "obese";
}
}
public float bmi_value(){
float bmi;
bmi=(weight*703)/(Height*Height);
return bmi;
}
static void Main() {
HealthProfile patient1 = new HealthProfile();
Console.WriteLine("----------------------Patient Health Record-----------------------------");
Console.WriteLine(" Patient Name: " + patient1.LastName + " " + patient1.FirstName);
Console.WriteLine(" Patient BirthYear : "+patient1.BirthYear);
Console.WriteLine(" Patient Age : "+patient1.person_age());
Console.WriteLine(" Patient Height(in inches): "+patient1.Height);
Console.WriteLine(" Patient weight(in pound) : "+patient1.weight);
Console.WriteLine(" Maximum Heart Rate : 170");
Console.WriteLine(" Target Heart Range: 85-144");
Console.WriteLine(" BMI Numeric Value : "+patient1.bmi_value());
Console.WriteLine(" BMI Text Value : "+patient1.BMI_calculate());
}
}
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)