+ 4
9th Jun 2020, 6:43 AM
Rahma Samir
Rahma Samir - avatar
3 Réponses
+ 3
calculate max heart rate as: 220 - age TargetHeartRate() returns one value so you can calculate middle value between 50% and 80% and use it as value of variable range or calculate 50% and 80% of max heart rate separately and print two numbers as target range of bpm if you need double result use decimal dot in one number (50/100.0) you need main method eg public static void main(String[] args) { var hr = new heartrate("John","Doe", 10,6,2000); System.out.printf("%.2f bpm\n", hr.TargetHeartRate() ); }
9th Jun 2020, 10:01 AM
zemiak
+ 11
1.are you trying to do without main method:(( 2.you didn't input any or print output statement for target heart beat rate 3 check the braces u didn't close.
9th Jun 2020, 7:09 AM
chaithra Gowda
chaithra Gowda - avatar
+ 3
reformat your code like this and it will get alot easier to find errors https://code.sololearn.com/cqsMEHQ2Zrzu/?ref=app
9th Jun 2020, 7:22 AM
Anton Böhler
Anton Böhler - avatar