JAVA制作关于金钱的节目 [英] JAVA make programming about money

查看:63
本文介绍了JAVA制作关于金钱的节目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用25-kuru,10-kuru,5-kuru和1的混合物编写一个程序来输入kurus中的金额并计算该金额的最小硬币数量

- 库鲁硬币。显示

数字和这些硬币的类型。

示例:

在Kurus中输入金额(> ; 1),(或< 1退出):117 
- 25个kurus中的4个
- 10个kurus中的1个
- 5个kurus中的1个
- 1个kurus中的2个
117 = 4 * 25 + 1 * 10 + 1 * 5 + 2 * 1

提示

整数除(/)和余数(%)运算是这里有用。



我尝试过的事情:



请帮助MAKE CODE java programming ..........

解决方案

对不起,没有;我们不为你做功课。家庭作业将用于测试你学到的东西,而不是专业开发人员已经知道的东西。研究您的课程笔记,并考虑解决问题所需的逻辑步骤。记下这些逻辑步骤,然后尝试将其转换为实际的Java代码。


Quote:

我已经尝试但我不能。我搜索得太多但我找不到溶剂。



拿一张纸和一支铅笔练习一些样品。

你应该会发现你没有尝试每种组合,那种方法就是你的算法。至少记下算法,它表明你对这个问题有所了解。

请注意,给予改变的问题可以扩展到钞票,这样做的可能性更大。一个循环和数组应该有帮助。



引用:

请帮助制作代码java编程..........



没有显示任何内容,你问的帮助是'做我的功课'

我们不做你的家庭工作。

HomeWork不会测试你乞求别人做你的工作的技能,它会让你思考并帮助你的老师检查你对你所学课程的理解以及你应用它们时遇到的问题。

你的任何失败都会帮助你的老师发现你的弱点并设定补救措施。

你的任何失败都会帮助你了解什么有效,什么无效,被称为'试错'学习。

所以,试一试,重读课程并开始工作。如果您遇到特定问题,请显示您的代码并解释这个问题,我们可能会提供帮助。



作为程序员,您的工作是创建算法解决特定问题,你不能依赖别人永远为你做,所以有一段时间你必须学会​​如何。而且越快越好。

当你要求解决方案时,就像试图通过培训其他人来学习开车一样。

创建算法基本上是找到数学并做出必要的调整以适应你的实际问题。



发展的概念就像这个词所暗示的那样:系统地使用科学和满足特定目标或要求的技术知识。 BusinessDictionary.com [ ^ ]

这与有一个不一样快速谷歌并放弃,如果我找不到正确的代码。


一旦你从用户那里得到,你能够计算硬币的数量。例如,如果 money = 117 那么你必须使用 4 25-kuru 币,因为(整数除法) 117 = 25/4 给出最大金额 25-kuru 您可以使用的硬币。

然后您将相同的参数应用于提醒( 117 - 4 * 25 = 17 ),依此类推。

Write a program to input a money amount in kurus and calculate the smallest number of coins
possible for that amount, using a mixture of 25-kuru, 10-kuru, 5-kuru and 1-kuru coins. Display the
number and the type of these coins.
Example:

Enter amount in Kurus (>1), (or <1 to quit): 117
- 4 of 25 kurus
- 1 of 10 kurus
- 1 of 5 kurus
- 2 of 1 kurus
117 = 4*25 + 1*10 + 1*5 + 2*1

Hint
The integer divide (/) and remainder (%) operations are useful here.

What I have tried:

PLEASE HELP FOR MAKE CODE java programming..........

解决方案

Sorry, no; we do not do your homework for you. Homework is set to test what you have learned, not what a professional developer already knows. Study your course notes and think about the logical steps needed to solve the problem. Write down those logical steps and then try and convert that into the actual Java code.


Quote:

I already tried but I couldn't. I searched too much but I can't find sollution.


Take a sheet of paper and a pencil and practice with some samples.
You should find that you do not try every combination, that method is your algorithm. At least write down the algorithm, it show you have an understanding of the problem.
Note that the problem of giving change can be extended to banknotes, this makes much more possibilities. A loop and array should help.

Quote:

PLEASE HELP FOR MAKE CODE java programming..........


With showing nothing, the help you ask is 'do my homework'
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.

As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better.
When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.

The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." BusinessDictionary.com[^]
That's not the same thing as "have a quick google and give up if I can't find exactly the right code".


Once you get money from the user, you are able to compute the quantity of coins. For instance, if money = 117 then you must use 4 of 25-kuru coins, because (integer division) 117= 25/4 gives you the maximum amount of 25-kuru coins you may use.
Then you apply the same argument to the reminder (117 - 4*25 = 17) and so on.


这篇关于JAVA制作关于金钱的节目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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