帮助目标心率计划 [英] Help with a Target Heart rate program

查看:67
本文介绍了帮助目标心率计划的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些是说明书,我不是要求任何人为我编码,而是想听听有关如何开始的一些想法,这只是想弄明白这件事在这种情况下是不起作用的!


编写一个程序HeartRates.java,它将一系列名称和年龄对作为输入,打印出锻炼的心率,并持续到用户键入q为止。或者已经执行了4次迭代。


计算运动心率(按q退出)

------------ -----------------------------------

姓名:John

输入年龄:20

约翰适合您的年龄:20

您的有氧区域是:150

您的脂肪燃烧区域是: 130

计算锻炼心率(按q退出)

------------------ -----------------------------

姓名:杰克

输入年龄:aaa

错误!再次检查年龄。


计算运动心率(按q退出)

--------------- --------------------------------

姓名:Joe

输入年龄:21

Joe适合您的年龄:21

您的有氧区域是:149

您的脂肪燃烧区域是:129


程序终止。再见!


如果你有任何想法会喜欢听他们,是的我需要自己学习这个,但我的教授表现得像我们已经应该知道如何编程。

These are the instructions, I am not asking anyone to code for me but would like to hear some ideas on how to start, this just trying to figure it out thing isn''t working in this case!

Write a program, HeartRates.java, that takes as input a series of name and age pairs, prints out heart rates for exercising, and continues until either the user types "q" or 4 iterations have been executed.

Computing heart rates for exercising (press q to exit)
-----------------------------------------------
Name: John
Enter age: 20
John for your age: 20
Your aerobic zone is: 150
Your fat Burning zone is: 130

Computing heart rates for exercising (press q to exit)
-----------------------------------------------
Name: Jack
Enter age: aaa
Error! Check age again.

Computing heart rates for exercising (press q to exit)
-----------------------------------------------
Name: Joe
Enter age: 21
Joe for your age: 21
Your aerobic zone is: 149
Your fat Burning zone is: 129

Program terminating. Bye!

if you have any ideas would love to hear them, yes I need to learn this on my own but my professor acts like we already should know how to program.

推荐答案

您使用的是C或C ++吗?


首先编写一个程序来读取一个人的数据,例如

(1)提示用户输入他/她的名字;

(2)如果使用C或字符串(如果使用C ++),则将名称读入char数组

(3)显示名称以查看是否已阅读确定

(4)提示使用进入年龄

(5)阅读年龄为浮点数

(6)显示年龄检查确定

(7)计算结果


当工作正常时你可以添加错误echecking,例如如果没有为年龄输入数值,则添加循环以处理多个人
are you working in C or C++ ?

start by writing a program to read data on one person, e.g.
(1) prompt user to enter his/her name;
(2) read the name into a char array if working in C or a string if in C++
(3) display name to check it was read OK
(4) prompt use to enter age
(5) read age into a float
(6) display age to check it is OK
(7) calculate results

when that is working you can add error echecking, e.g. if a numeric value is not entered for age, then add a loop to deal with more than one person



您是在C或C ++?
are you working in C or C++ ?



看到这是Java论坛,我假设他正在使用Java,horace ...... XD


你在运行什么版本的Java?您将使用什么算法来计算输出?


到目前为止您编写了什么代码?

Seeing as this is the Java forum, I''d assume he''s using Java, horace...XD

What version of Java are you running? What algorithm will you be using to calculate the output?

What code have you written so far?



看到这是Java论坛,我会假设他正在使用Java,horace ...... XD
Seeing as this is the Java forum, I''d assume he''s using Java, horace...XD



猜猜你就在那里Gannon11!

我一直都在编码,所以我经常发现我在java程序中编写C ++等等等等等等等。
我的想法现在是

首先编写一个程序来读取一个人的数据,例如

(1)提示用户输入他/她的名字;

(2 )将名称读成字符串

(3)显示名称以检查它是否已读取确定

(4)提示使用进入年龄

(5)读入年龄浮充

(6)显示年龄检查确定

(7)计算结果


当它工作时你可以添加错误,例如如果未为年龄输入数值,则添加循环以处理多个人

guess you a right there Gannon11 !
I code in both all the time so I often find I am writing C++ in a java program, etc etc!

my idea is now
start by writing a program to read data on one person, e.g.
(1) prompt user to enter his/her name;
(2) read the name into a String
(3) display name to check it was read OK
(4) prompt use to enter age
(5) read age into a float
(6) display age to check it is OK
(7) calculate results

when that is working you can add error echecking, e.g. if a numeric value is not entered for age, then add a loop to deal with more than one person


这篇关于帮助目标心率计划的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆