- 资源介绍
- 更新记录
- 安装教程
若有个人部署运行问题,点击右侧客服按钮咨询站长
项目介绍
Calculator Website
The George Washington University
Computer Science 1023
Professor Brenner (nbrenner@gwu.edu)
Build a website to simulate a simple four function calculator. Include two input boxes and one output textbox. On a button click, perform the arithmetic calculation and update the output box. Include an error message if division by 0 is attempted. Here is a sample webpage:
Appearance of the calculator just after the multiply button was clicked
Hints on constructing the program:
- First build the HTML with all the features shown in the sample.
- Add the onclick option to each button to go to a different Javascript function (so four Javascript functions must be written).
- Write and debug (using alert() pop-ups) the code for one of the arithmetic functions, say multiply.
- Only when that one button is working correctly should you copy its code, paste it into the other functions and make the appropriate (and very minor) changes.
- In each button function, first read in the input values that the user inserted; e.g. x = textboxname.value and similarly for y for the two input values.
- Perform the appropriate arithmetic operation. (NOTE: when performing addition, beware of the Javascript ambiguity regarding the plus sign; either use subtraction twice or else multiply the input values (which are strings) by 1 to convert them to numbers.)
- Place the numeric result into the output box by the converse of the way you copied in the input values.
- If you have trouble comparing to 0, try comparing to “0”
- Turn on the error console for the browser (F12 usually) you are using so that you will see any error messages from Javascript (in the Console).
适用场景:
运行截图
关注【程序代做 源码分享】公众号获取更多免费源码!!!
猜你喜欢
-
html美食展示页面
2021-05-20 -
商城前端html源码
2021-07-08 -
旅游网页6页面,广安市前锋区+课程设计报告
2021-09-07 -
html前端6页面旅游网页
2021-05-12 -
html前端比较好个性5页面简历
2021-05-13 -
html前端6个页面个人简历
2021-05-14 -
公司网站9页面
2021-05-18 -
我们毕业了10网页
2021-09-08 -
python个性化电影推荐第三版源码+论文
2021-05-22 -
学校主页2页面
2021-05-14
-
h5 pc摄像头
2021-10-25 -
简单学生北京介绍页面
2021-05-18 -
Election Website The George Washington University Computer Science 1023 Professor Brenner (nbrenner@gwu.edu)
2021-05-14 -
登录和后台系统界面html
2021-07-31 -
网页简易四则运算器
2021-05-18 -
Creating a Log-in Webpage The George Washington University Computer Science 1023 Professor Brenner (nbrenner@gwu.edu)
2021-05-14 -
List and Table Elements of HTML The George Washington University Computer Science 1023 Professor Brenner (nbrenner@gwu.edu)
2021-05-18 -
比较专业的公司网页5页面
2021-05-14 -
5个网页制作课作业
2021-09-08 -
简易的电商html
2021-07-08
猜你在找
99源码网 » 网页简易四则运算器
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
- 提示下载完但解压或打开不了?
- 找不到素材资源介绍文章里的示例图片?
- 99源码网
- 2021-05-18Hi,初次和大家见面了,请多关照!