Java Code for Heart Rate

This java programming code is used to find the heart rate. You can select the whole java code by clicking the select option and can use it. When you click text, the code will be changed to text format. This java program code will be opened in a new pop up window once you click pop-up from the right corner. You can just copy, paste this java code and use it to find the heart rate.

import java.util.*;
import java.lang.*;
import java.lang.Math.*;
class Heartrate
{  
    public static void main(String args[])
    {
        double rate=12,age=50;
        double maxrate = 220;
        double heartrate = maxrate - age;
        double val = heartrate - rate;

        double res1 = (val*0.4);
        double res2 = (val*0.6);

        double targetmin = res1+rate;
        double targetmax = res2+rate;
        
        System.out.println("Heart beat low rate: "+targetmin+" - "+targetmax);
        
        res1 = (val*0.6);
        res2 = (val*0.7);
        
        targetmin = res1+rate;
        targetmax = res2+rate;
        System.out.println("Heart beat medium rate: "+targetmin+" - "+targetmax);
        
        res1 = (val*0.7);
        res2 = (val*0.85);
        
        targetmin = res1+rate;
        targetmax = Math.round(res2+rate)*1000/1000;
        System.out.println("Heart beat high rate: "+targetmin+" - "+targetmax);

    }
}
Other Programming Codes
Online Calculator : Heart Rate
Click on the select code link to copy and paste this free java program code for heart rate.

english Calculators and Converters

Ask a Question


Sitemap