帮助功能 [英] Help with function

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

问题描述

尝试编写一个执行以下操作的函数:


Joe每出售30个小部件就获得100分。


所以如果他卖不到三十,他一无所获。如果他得到30到

59他得到100,60-89他得到200,90-119他得到300等......


如何根据当时的小部件数量显示joe得到的分数

输入。

Trying to write a function that does the following:

Joe gets 100 points for every 30 widgets he sells.

So if he sells less than thirty he gets nothing. If he gets between 30 and
59 he gets 100, 60-89 he gets 200, 90-119 he gets 300 etc.....

How can I display the points joe gets depending on then number of widgets
entered.

推荐答案

没有什么比寻求帮助更好的了然后被击中脸部。那么无视。

" Victor Bazarov" <五******** @ attAbi.com>在消息中写道

news:vj ************ @ corp.supernews.com ...
Nothing like asking for help and getting shot in the face. Disregard then.
"Victor Bazarov" <v.********@attAbi.com> wrote in message
news:vj************@corp.supernews.com...
" Paul" < PB@nospam.networktel.net>写了...
"Paul" <PB@nospam.networktel.net> wrote...
尝试编写一个执行以下操作的函数:

Joe每售出30个小部件就得100分。

所以如果他卖不到三十,他什么也得不到。如果他得到30
Trying to write a function that does the following:

Joe gets 100 points for every 30 widgets he sells.

So if he sells less than thirty he gets nothing. If he gets between 30


59他得到100,60-89他得到200,90-119他得到300等.....

如何根据输入的
小部件的数量显示joe得到的分数。
59 he gets 100, 60-89 he gets 200, 90-119 he gets 300 etc.....

How can I display the points joe gets depending on then number of widgets entered.



你做了什么(除了输入你的作业)?<如果您有一个无法编译的程序,发布它,我们可以帮助您解决它。如果你什么也没做,那就去做吧。我们可以提供帮助,但是我们不打算为你做功课。

如果您不知道从哪里开始,这里有一个简单的程序允许您输入一个数字,然后将其打印回来:

#include< iostream>
使用命名空间std;

int main()
{
cout<< 输入一个数字 << flush;
int number;
cin>>数字;
cout<< 你进入了 <<数字<< endl;
返回0;
}

Victor



What have you already done (aside from typing your assignment)?
If you have a program that doesn''t compile, post it, we could
help you fix it. If you haven''t done nothing, well, go do
something. We can help, but we''re not going to do your homework
for you.

If you don''t know where to begin, here is a simple program that
allows you to enter a number and then it prints it back:

#include <iostream>
using namespace std;

int main()
{
cout << "enter a number " << flush;
int number;
cin >> number;
cout << "you entered " << number << endl;
return 0;
}

Victor



无论如何我知道如果我将小部件的数量除以30然后

取整个

的结果数并乘以100我会得到它。以为可能会更清洁。


" Paul" < PB@nospam.networktel.net>在消息中写道

news:vj ************ @ corp.supernews.com ...
In anycase I know that if I divide the number of widgets by 30 and then
taking the whole
number of the result and multiply by 100 I will get it. Thought there might
be a cleaner way.

"Paul" <PB@nospam.networktel.net> wrote in message
news:vj************@corp.supernews.com...
试着编写一个函数以下内容:乔每卖出30件小部件就得100分。

因此,如果他的售价低于30,他什么也得不到。如果他得到30
到59之间他得到100,60-89他得到200,90-119他得到300等.....

我怎样才能显示乔得到的分数取决于当时输入的小部件数量。
Trying to write a function that does the following:

Joe gets 100 points for every 30 widgets he sells.

So if he sells less than thirty he gets nothing. If he gets between 30 and 59 he gets 100, 60-89 he gets 200, 90-119 he gets 300 etc.....

How can I display the points joe gets depending on then number of widgets
entered.





" Paul" < TI ** @ nospamaol.com>在消息中写道

新闻:vj ************ @ corp.supernews.com ...

"Paul" <ti**@nospamaol.com> wrote in message
news:vj************@corp.supernews.com...
没有什么比寻求帮助和获得更多拍了一下脸。然后忽略
Nothing like asking for help and getting shot in the face. Disregard then.




没有人'击中你的脸(甚至打你的脸)。还有

三个很好的理由,为什么你应该发布你已经写过的代码,


1)它可以帮助每个人评估你已经拥有的技能和所以提供建议

适合你的技能水平

2)它有助于描述你的问题以及你究竟是多么坚持

比散文描述可以做,因此海报不会浪费

时间回答错误的问题。

3)它证明你准备自己做一些努力,只是希望得到答案而不是



这些规则适用于所有人,没有人会选择你。所以,发布代码

你已经写好了,你会很快得到很好的答案,并且

每个人都会很开心。


john



No-one''s shot you in the face (or even slapped you in the face). There are
three good reasons why you should post the code you''ve already written,

1) It helps everyone assess what skill you already have and so give advice
appropriate to your level of skill
2) It helps describe your problem and what exactly you are stuck on much
better than a prose description can ever do, therefore posters won''t waste
time answering the wrong question.
3) It proves that you are prepared to make some effort yourself, and aren''t
just expecting to be handed the answer.

These rules apply to everyone, no-one is picking on you. So, post the code
you''ve already written and you''ll get good answers very quickly, and
everyone will be happy.

john


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

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