- 资源介绍
- 更新记录
- 安装教程
购买后自动跳转百度云,项目自提,轻松方便。
若有个人部署运行问题,点击右侧客服按钮咨询站长
若有个人部署运行问题,点击右侧客服按钮咨询站长
项目介绍
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).
适用场景:
运行截图
关注【程序代做 源码分享】公众号获取更多免费源码!!!

猜你在找
99源码网专注代写Java程序,php程序,网站建设,毕业设计,课程设计,代写C/C++程序,代写数据结构,代写ios android程序。除外还代做Web开发、Php网站开发、ASP.NET网站作业等。
99源码网 » 网页简易四则运算器
99源码网 » 网页简易四则运算器
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
- 提示下载完但解压或打开不了?
- 找不到素材资源介绍文章里的示例图片?
- 99源码网
- 2021-05-18Hi,初次和大家见面了,请多关照!