首页 文章

用于分配机器的视觉硬币改变系统

提问于
浏览
1

最近我被赋予了一项工作,在一个新的项目中工作...我已经做了一些日常和夜晚的思考如何处理它....不幸的是,这个想法没有成功,目前正在设计阶段挣扎 . 基本上前提是:

"The management of Ruddles, a well known local department store has decided to implement certain changes to the customer tills throughout the store. Because of problems with staff in providing customers with correct change for their purchases, in future the change will be calculated automatically from the price of the goods and the amount tendered by the customer. The coins will be dispensed automatically by the tills, which are about to be replaced with machines capable of mechanical dispensing."

这只是关于业务本身的一些信息 . 以下是给我的要求规范:

"As at present, the member of staff (the cashier) will enter the purchases, and the system will calculate the total cost. This part of the system currently operates satisfactorily, and no changes (!) are envisaged. The total cost will be passed to the new machine, and the amount tendered by the customer will also be entered. The system will then calculate the amount of change due, and will provide the hardware interface with a list of coin denominations and the number of each to be dispensed. This constitutes the first part of the exercise. However, management has just realised that the coin dispensing machines will need to be replenished with coins from time to time, and would like the system to be able to keep track of the numbers of coins of different denominations, and issue warnings when the number of coins of any given denomination falls below a certain value. You should therefore include facilities to provide such provision in your solution. At the present time, the hardware is unable to dispense notes, but future developments may make it possible, and your solution should be such as to cope with this should theses improvements occur. You should therefore indicate what changes would be necessary to the software in the event that such hardware upgrading takes place."

目前我真的不确定如何处理项目的以下要求所以我只是想知道你们中谁比我更有知识和经验可以提供一些建议或建议,这将非常感谢您的时间和关注:-)

我知道可能有多种方法可以接近,但到目前为止,我理解数组需要使用和持久性结构,虽然我不完全确定..

幸运的是,只要它完成这项工作,就不必过度完成 . 我再次感谢您给我的任何建议或提示 . 谢谢 .

2 回答

  • 1

    所描述的“软件”具有输入:总购买量和客户提供的总量,并输出:硬币面额列表和每个硬币的数量 . 听起来像是对我的函数的定义 . 找出每个参数的良好数据类型,并写出函数的签名 .

  • 0

    如果我是你,那就开始吧 . 假装你只有一种硬币类型,并想出一些适合它的东西 . 然后,将设计扩展为两个不同值的硬币 . 在此之后,您将获得更好的感觉,并且您应该能够看到如何扩展您的解决方案以应对具有多种不同面额的硬币 .

    并且忘记了持久性位,直到你有其他一些基础工作 .

    如果你尝试在头脑中设计整个事物而不实际执行任何代码,你的大脑可能会爆炸 . 因此,将问题分解为可以管理的块 .

    这听起来像个有趣的问题,祝你好运!

相关问题