- 资源介绍
- 更新记录
- 安装教程
若有个人部署运行问题,点击右侧客服按钮咨询站长
项目介绍
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 -
boostrap webapp电商前端页面
2021-05-14 -
5个网页制作课作业
2021-09-08 -
单页面旅游介绍
2021-05-14 -
html美食展示页面
2021-05-20 -
旅游网页6页面英文版
2021-09-07 -
html前端6个页面个人简历
2021-05-14 -
进度报告单页面
2021-05-18 -
html网上订餐页面
2021-05-20 -
网页集合
2021-09-08
-
Pig Latin Lab The George Washington University Computer Science 1023 Professor Brenner (nbrenner@gwu.edu)
2021-05-14 -
图片上生成水印图片并保存合并图片升级版
2021-09-07 -
html前端紫色个人简介网页源码
2021-05-12 -
四川羌族文化展览网站界面设计与实现毕业论文+开题报告+Html静态网站源码
2021-06-08 -
拖拽添加文字水印
2021-09-07 -
html前端智能客服页面源码+报告
2021-05-13 -
html前端飞机大战
2021-09-07 -
网页简易四则运算器
2021-05-18 -
环保5页面
2021-05-18 -
Election Website The George Washington University Computer Science 1023 Professor Brenner (nbrenner@gwu.edu)
2021-05-14
猜你在找
99源码网 » 网页简易四则运算器
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
- 提示下载完但解压或打开不了?
- 找不到素材资源介绍文章里的示例图片?
- 99源码网
- 2021-05-18Hi,初次和大家见面了,请多关照!