文件名称:calcultor
介绍说明--下载内容均来自于网络,请自行研究使用
/*6. 模拟计算器程序
问题描述
设计一个程序来模拟一个简单的手持计算器。程序支持算术运算+、-、*、/、=、以及C(清除)、A(全清除)操作。
基本要求
程序运行时,显示一个窗口,等待用户输入,用户可以从键盘输入要计算的表达式,输入的表达式显示在窗口中,用户键入 = 符号后,窗口显示出结果。
测试数据
程序输入不少于5种不同的表达式进行测试。
实现提示
可定义一个计算器类,该类包括两个组件对象,一个计算引擎和一个用户接口,用户接口对象处理接受的键盘输入信息,并显示答案,计算引擎对象对给出的数据执行相应操作,并存储操作的结果。
选作内容
如果用户输入的表达式不合法,可以判别出来并给出相应的错误提示。*/-/* 6 the analog calculator program to describe the design of a program to simulate a simple hand-held calculator. Supports arithmetic+,-,*, /, =, and C (Clear), A (all clear) operation. The basic requirements of the program is running, a window, waiting for user input, the user can be calculated from the keyboard input expression, enter the expression in the window, the user type ' =' symbol, the window shows the results. The test data program input of not less than five different expression is tested. Prompted to define a calculator class, including the object of two components, a calculation engine and a user interface, the user interface object accept keyboard input information processing, and display the answer, and perform the corresponding calculation engine object data given operation, and stores the result of the operation. Selected as illegal user input expression can be judged out and gives the corresponding error.* /
问题描述
设计一个程序来模拟一个简单的手持计算器。程序支持算术运算+、-、*、/、=、以及C(清除)、A(全清除)操作。
基本要求
程序运行时,显示一个窗口,等待用户输入,用户可以从键盘输入要计算的表达式,输入的表达式显示在窗口中,用户键入 = 符号后,窗口显示出结果。
测试数据
程序输入不少于5种不同的表达式进行测试。
实现提示
可定义一个计算器类,该类包括两个组件对象,一个计算引擎和一个用户接口,用户接口对象处理接受的键盘输入信息,并显示答案,计算引擎对象对给出的数据执行相应操作,并存储操作的结果。
选作内容
如果用户输入的表达式不合法,可以判别出来并给出相应的错误提示。*/-/* 6 the analog calculator program to describe the design of a program to simulate a simple hand-held calculator. Supports arithmetic+,-,*, /, =, and C (Clear), A (all clear) operation. The basic requirements of the program is running, a window, waiting for user input, the user can be calculated from the keyboard input expression, enter the expression in the window, the user type ' =' symbol, the window shows the results. The test data program input of not less than five different expression is tested. Prompted to define a calculator class, including the object of two components, a calculation engine and a user interface, the user interface object accept keyboard input information processing, and display the answer, and perform the corresponding calculation engine object data given operation, and stores the result of the operation. Selected as illegal user input expression can be judged out and gives the corresponding error.* /
(系统自动生成,下载前可以参看下载内容)
下载文件列表
calcultor.cpp