C++ 写一个带界面的小程序,长得好像计算器一样,按多少显示多少。已有模板,只需完成其中几个地方

要求:creatingasmallprogramthatlookslikethekeypadofacalculator.Youshouldtrytorecreatethe... 要求:creating a small program that looks like the keypad of a calculator. You should try to recreate the screenshot on the next page. For reference, the frame is 300-by-300 pixels and the number (and dot) buttons are in a separate panel. Think carefully about the types of layout managers to use for each section of the frame. The accumulator label should begin with the text “0”. For the accumulator label, I use the following code to make the font larger and right-aligned:label.setFont(new Font("Arial", Font.PLAIN, 40)); label.setHorizontalAlignment(SwingConstants.RIGHT);Functional Requirements You also have a number of functional requirements. Whenever you press a key, you should append the label of that key onto the accumulator label. This allows you to type numbers. However, you should be aware of several things:Leading zeroes should be ignored. If your first click is the “2” button, the accumulator should read “2”, not “02”.You should only allow one dot to be entered. A second press of the button should have no observable effectIf you press “C” button, the number should be cleared and be replaced with “0”.It is up to you to figure out how to elegantly handle these cases. 展开
 我来答
yb0319
2016-11-15 · TA获得超过188个赞
知道小有建树答主
回答量:590
采纳率:0%
帮助的人:287万
展开全部
你这个是JAVA好吧?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式