文件名称:calculator
- 所属分类:
- 控制台(字符窗口)编程
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- wangli******
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
计算器,功能要求:
<1>用户输入算式文本,确定后程序给出计算结果,支持两个操作数的加减乘除四则运算即可。例如
用户输入“1234+5678”,敲回车键后,屏幕显示“1234+5678=6912”,然后等待用户输入下一个算式文本;
又如用户输入“123/78”,敲回车键后,屏幕显示“123/78=1.577”, 然后等待用户输入下一个算式文本;
乘法符号用“*”表示
<2>操作数最多不超过四位,可以是整数或小数;结果如果是小数,保留到小数点后3位。
<3>容错功能要求:
当用户输入不合法的文本表达式,程序应提示用户输入错误。例如:用户输入“12f5+123”时,程序应报错,并指出错误内容。
发挥部分:
<4>如果程序还可支持其它运算符(例如指数、开方、sin、log、ln等-Calculator, function requirements:
< 1 > user input factor text, determine the program after calculation results, support two operands arithmetic can add, subtract, multiply and divide. For example
User input "1234+ 5678", press enter key, and the screen shows "1234+ 5678 = 6912", then wait for users to enter the next formula text
And as the user input "123/78", press enter key, the screen display "123/78 = 1.577" and then wait for the users to enter the next formula text
Multiplication sign with "*" said
< 2 > operator at most four, can be an integer or a decimal Results if the decimal, keep to three decimal point.
< 3 > fault-tolerant function requirements:
When the user input illegal text expression, the program should prompt the user input error. For example: the user input "12 f5+ 123", the program should be error, and pointed out the mistake content.
Play a part:
< 4 > if the program can also support other operator (such as index, prescribing,
<1>用户输入算式文本,确定后程序给出计算结果,支持两个操作数的加减乘除四则运算即可。例如
用户输入“1234+5678”,敲回车键后,屏幕显示“1234+5678=6912”,然后等待用户输入下一个算式文本;
又如用户输入“123/78”,敲回车键后,屏幕显示“123/78=1.577”, 然后等待用户输入下一个算式文本;
乘法符号用“*”表示
<2>操作数最多不超过四位,可以是整数或小数;结果如果是小数,保留到小数点后3位。
<3>容错功能要求:
当用户输入不合法的文本表达式,程序应提示用户输入错误。例如:用户输入“12f5+123”时,程序应报错,并指出错误内容。
发挥部分:
<4>如果程序还可支持其它运算符(例如指数、开方、sin、log、ln等-Calculator, function requirements:
< 1 > user input factor text, determine the program after calculation results, support two operands arithmetic can add, subtract, multiply and divide. For example
User input "1234+ 5678", press enter key, and the screen shows "1234+ 5678 = 6912", then wait for users to enter the next formula text
And as the user input "123/78", press enter key, the screen display "123/78 = 1.577" and then wait for the users to enter the next formula text
Multiplication sign with "*" said
< 2 > operator at most four, can be an integer or a decimal Results if the decimal, keep to three decimal point.
< 3 > fault-tolerant function requirements:
When the user input illegal text expression, the program should prompt the user input error. For example: the user input "12 f5+ 123", the program should be error, and pointed out the mistake content.
Play a part:
< 4 > if the program can also support other operator (such as index, prescribing,
(系统自动生成,下载前可以参看下载内容)
下载文件列表
calculator.c