如何为库存项目抽象数据类型创建C ++类? [英] How to create a C++ class for Stock item Abstract Data Type?

查看:115
本文介绍了如何为库存项目抽象数据类型创建C ++类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

有人知道以下C ++问题的解决方案吗?

我需要你的帮助.请尽快给我发送解决方案

问:为库存项目抽象数据类型创建一个C ++类.它应该具有库存水平(整数)和单价(浮动)的属性.定义方法以返回这两个属性的值并使用参数进行设置.添加另外两种方法以允许收货和根据情况更新库存水平的发货.编写一个菜单驱动的程序来解决上述问题.

Dear All,

Is anybody knows solution of below C++ question?

I need your help. Please send me the solution ASAP

Q: Create a C++ class for stock item abstract data type. It should have the attributes of stock levels (an integer) and unit price (a float). Define the methods to return the values of these two attributes and to set them using parameters. Add two more methods to allow stock receipts and issues updating the stock level as appropriate. Write a menu driven program to implement the above problem.

推荐答案

好吧,我确定这里至少有10个人会定期与我联系,可以做到这一点.为你.对于他们每个人,可能还有另外10个我不认识的人.对他们而言,对他们来说是件好事,对您来说,坏事是他们已经拥有学位/经验,而您没有.

因此,请返回您的教科书,查找基本的OO设计,信息隐藏和构造函数.如果您现在不知道那一刻,那么我希望您的学年不会像英国大多数人那样在六月结束.

哦,虽然您在使用它,但要获得额外的信誉,请考虑使用浮点数作为单价的利弊.对我来说,这听起来像是一个坏主意,但也许您的讲师有道理.否则,他会吠叫,您应该退还您的学费:-).
Well I''m sure there are at least 10 people on here I correspond with regularly that could do this for you. And for each of them there''s probably another 10 who could that I don''t know. The good thing for them and the bad thing for you is that they''ve got degrees/experience already and you haven''t.

So go back to your textbook(s) and look up basic OO design, information hiding and constructors. If you don''t know that now then I hope your academic year doesn''t end in June the way most do in the UK.

Oh, and while you''re at it, for additional credit, consider the pros and cons of using a float for unit price. It sounds like a bad idea to me but perhaps your lecturer has a reason. Otherwise he''s barking and you should claim your course fees back :-).


好吧,您应该自己做作业.开始设计抽象类,并在遇到困难时在此处发布特定问题.
Well, you should do you own homework. Start designing your abstract class and post here specific questions whenever you''re stuck.


这篇关于如何为库存项目抽象数据类型创建C ++类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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