- 资源介绍
- 更新记录
- 安装教程
若有个人部署运行问题,点击右侧客服按钮咨询站长
项目介绍
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).
适用场景:
运行截图
关注【程序代做 源码分享】公众号获取更多免费源码!!!
猜你喜欢
-
旅游网页6页面英文版
2021-09-07 -
html前端4页面早教课程网页源码
2021-05-12 -
环保5页面
2021-05-18 -
学校主页2页面
2021-05-14 -
Pig Latin Lab The George Washington University Computer Science 1023 Professor Brenner (nbrenner@gwu.edu)
2021-05-14 -
html前端校园介绍网页10多个页面
2021-05-14 -
Forms and Input Elements of HTML The George Washington University Computer Science 1023 Professor Brenner (nbrenner@gwu.edu)
2021-05-18 -
html网上订餐页面
2021-05-20 -
html旅游网页前后台
2021-05-20 -
四川羌族文化展览网站界面设计与实现毕业论文+开题报告+Html静态网站源码
2021-06-08
猜你在找
99源码网,程序代做,代写程序代码,代写编程,代写Java编程,代写php编程,计算机专业代做,计算机毕业设计,网站建设,网站开发,程序 » 网页简易四则运算器
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
- 提示下载完但解压或打开不了?
- 找不到素材资源介绍文章里的示例图片?
- 99源码网
- 2021-05-18Hi,初次和大家见面了,请多关照!