且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

简单算法

更新时间:2023-02-26 17:56:36

" savesdeday" <再*********** @ yahoo.com>写了...
"savesdeday" <re***********@yahoo.com> wrote...
在我的初级计算机科学课上,我们被要求翻译一个简单的兴趣问题。我们期望编写一个算法来获得起始账户余额B,年利率I和年度服务费用S的值。然后,您的算法将计算并打印出总数年内赚取的利息金额和年末的最终账户余额(假设利息每月复利,服务费扣除一次,在
结束时)那一年)。在本实验作业中,您将此算法转换为C ++程序。
程序的示例运行如下所示:
输入开始帐户余额:300.00
输入年利率:5.5
输入年度服务费:10
所得利息总额为:16.9224
最终账户余额为:306.922

这里有一些要打印数量的公式:
所得利息总额= [(1 + I / 12)12 - 1] * B
期末账户余额= B +(所得利息总额) - S >
任何人都可以帮我解决这个问题吗?非常感谢您提前。
In my beginnning computer science class we were asked to translate a
simple interest problem. We are expected to write an algorithm that
gets values for the starting account balance B, annual interest rate
I, and annual service charge S. Your algorithm would then compute and
print out the total amount of interest earned during the year and the
final account balance at the end of the year (assuming that interest
is compounded monthly, and the service charge is deducted once, at the
end of the year). In this lab assignment you will convert this
algorithm into a C++ program.
A sample run of your program would look like the following:
Enter the beginning account balance: 300.00
Enter the annual interest rate: 5.5
Enter the annual service charge: 10
The total interest earned is: 16.9224
The final account balance is: 306.922

Here are some formulas for the quantities to be printed:
Total interest earned = [(1+I/12)12 - 1]*B
Final account balance = B + (total interest earned) - S

Can anyone help me out with this? Thank you kindly in advance.




不,我们在这里帮不了你。如果你需要算法,请发布到新闻组

''comp.programming''(虽然我很确定他们也不会为你做你的b / b
作业)。一旦你有算法,我们肯定

可以帮助你使用C ++部分,但是你需要首先阅读FAQ部分5




No, we cannot help you here. If you need algorithms, post to newsgroup
''comp.programming'' (although I am fairly certain they won''t do your
homework for you either). Once you have the algorithm, we definitely
can help you with C++ part, but you need to read the FAQ section 5
first.




" savesdeday" &LT;再*********** @ yahoo.com&GT;在消息中写道

news:57 ************************** @ posting.google.c om ...

"savesdeday" <re***********@yahoo.com> wrote in message
news:57**************************@posting.google.c om...
在我的初级计算机科学课上,我们被要求翻译一个简单的兴趣问题。我们期望编写一个算法来获得起始账户余额B,年利率I和年度服务费用S的值。然后,您的算法将计算并打印出总数年内赚取的利息金额和年末的最终账户余额(假设利息每月复利,服务费扣除一次,在
结束时)那一年)。在本实验作业中,您将此算法转换为C ++程序。
程序的示例运行如下所示:
输入开始帐户余额:300.00
输入年利率:5.5
输入年度服务费:10
所得利息总额为:16.9224
最终账户余额为:306.922

这里有一些要打印数量的公式:
所得利息总额= [(1 + I / 12)12 - 1] * B
期末账户余额= B +(所得利息总额) - S >
任何人都可以帮我解决这个问题吗?非常感谢您提前。
In my beginnning computer science class we were asked to translate a
simple interest problem. We are expected to write an algorithm that
gets values for the starting account balance B, annual interest rate
I, and annual service charge S. Your algorithm would then compute and
print out the total amount of interest earned during the year and the
final account balance at the end of the year (assuming that interest
is compounded monthly, and the service charge is deducted once, at the
end of the year). In this lab assignment you will convert this
algorithm into a C++ program.
A sample run of your program would look like the following:
Enter the beginning account balance: 300.00
Enter the annual interest rate: 5.5
Enter the annual service charge: 10
The total interest earned is: 16.9224
The final account balance is: 306.922

Here are some formulas for the quantities to be printed:
Total interest earned = [(1+I/12)12 - 1]*B
Final account balance = B + (total interest earned) - S

Can anyone help me out with this? Thank you kindly in advance.




我们可以而且肯定会帮助您完成代码。很快

,当你向我们展示它,并询问有关它的具体问题时,

即是。


-MIke



We can and certainly will help you with your code. As soon
as you show it to us, and ask specific questions about it,
that is.

-MIke




" savesdeday" &LT;再*********** @ yahoo.com&GT;在消息中写道

news:57 ************************** @ posting.google.c om ...

"savesdeday" <re***********@yahoo.com> wrote in message
news:57**************************@posting.google.c om...
在我的初级计算机科学课上,我们被要求翻译一个简单的兴趣问题。我们期望编写一个算法来获得起始账户余额B,年利率I和年度服务费用S的值。然后,您的算法将计算并打印出总数年内赚取的利息金额和年末的最终账户余额(假设利息每月复利,服务费扣除一次,在
结束时)那一年)。在本实验作业中,您将此算法转换为C ++程序。
程序的示例运行如下所示:
输入开始帐户余额:300.00
输入年利率:5.5
输入年度服务费:10
所得利息总额为:16.9224
最终账户余额为:306.922

这里有一些要打印数量的公式:
所得利息总额= [(1 + I / 12)12 - 1] * B
期末账户余额= B +(所得利息总额) - S >
任何人都可以帮我解决这个问题吗?请您提前感谢。
In my beginnning computer science class we were asked to translate a
simple interest problem. We are expected to write an algorithm that
gets values for the starting account balance B, annual interest rate
I, and annual service charge S. Your algorithm would then compute and
print out the total amount of interest earned during the year and the
final account balance at the end of the year (assuming that interest
is compounded monthly, and the service charge is deducted once, at the
end of the year). In this lab assignment you will convert this
algorithm into a C++ program.
A sample run of your program would look like the following:
Enter the beginning account balance: 300.00
Enter the annual interest rate: 5.5
Enter the annual service charge: 10
The total interest earned is: 16.9224
The final account balance is: 306.922

Here are some formulas for the quantities to be printed:
Total interest earned = [(1+I/12)12 - 1]*B
Final account balance = B + (total interest earned) - S

Can anyone help me out with this? Thank you kindly in advance.




您不知道哪些部分?该程序要求你做简单的输入,简单的输出和计算公式(我会毫不犹豫地称之为

算法),你甚至已经给出要使用的公式。据推测,你已经在课堂上覆盖了所有这些。通常它是''把所有这些放在一起''部分

哪个难倒新手。


***的建议是简单的去,写一些代码,看它是否编译了

,如果编译它是否正确运行。如果你有一些代码并且你不知道为什么它不起作用,那么就把它贴在这里你会得到帮助。


你不会得到的是人们为你工作,这不公平。


john



Which parts don''t you know about? The program requires you to do simple
input, simple output and calculate a formula (I''d hesitate to call it an
algorithm), you''ve even been given the formulae to use. Presumably you''ve
covered all these in class. Usually its the ''putting it all together'' part
which stumps newbies.

The best advice is simple to have a go, write some code, see if it compiles
and if it compiles see if it runs correctly. When you have some code and you
can''t see why it isn''t working, then post it here and you''ll get help.

What you won''t get is people doing the work for you, that wouldn''t be fair.

john