Back-end separation calculator programming

目录

I. PSP Table

II. Presentation of My Calculator

III. Design and Implementation Process

IV. Code Explanation

V. Personal Journey and Learnings


The Link Your Classhttps://bbs.csdn.net/forums/ssynkqtd-04
The Link of Requirement of This Assignmenthttps://bbs.csdn.net/topics/617378696
Link to the finished project codekk/ at main · kaleidoscape/kk (github.com)
The Aim of This Assignment< Back End Separation Calculator>
MU STU ID and FZU STU ID<21125180_832102207>

I. PSP Table

Personal Software Process StagesEstimated Time(minutes)Actual Time(minutes)
Planning (Total)600700
• Estimate and Preparation600700
Development (Total)350400
• Analysis5050
• Design Spec1020
• Design Review1030
• Coding Standard1010
• Design2045
• Coding120200
• Code Review6070
• Test7080
Reporting (Total)7080
• Test Report00
• Size Measurement00
• Postmortem & Process Improvement Plan7080
Sum9101180

II. Presentation of My Calculator

III. Design and Implementation Process

A calculator application implemented in JavaScript and PHP, including the functionality of a basic calculator and a scientific calculator, and interacting with a MySQL database to save history. JavaScript is used to send expressions entered by the user to the server side, which evaluates the result using the eval() function and stores the expression and result in a MySQL database.

The front end interface includes a history list that is automatically updated after each calculation to display the last 10 calculation histories.

IV. Code Explanation

The front-end code is written using HTML, CSS, and JavaScript. It includes a text box for the user to input expressions, as well as buttons for entering numbers, operators, and executing calculations. There is also an area to display the result and a list to display the history of calculations.

  • The appendToExpression(value) function is used to add values to the expression text box.
  • The clearExpression() function is used to clear the content of the expression text box.
  • The calculate() function sends the expression to the server for calculation and displays the result in the result area. It also calls the storeInDatabase() function to store the expression and result in the database and the updateHistoryList() function to update the history record list.
  • The storeInDatabase(expression, result) function stores the expression and result in a MySQL database. It uses an XMLHttpRequest object to send the data to a back-end processing script named store.php.
  • The updateHistoryList() function gets the most recent calculation history and updates the history record list. It uses an XMLHttpRequest object to get history data from a back-end processing script named history.php and renders it in an HTML list.

The back-end code is written using PHP, and it performs calculation and storage operations by interacting with a MySQL database.

  • The calculate.php script receives the expression from the front-end and calculates the result using the eval() function. It then returns the result in JSON format to the front-end.
  • The store.php script receives the expression and result from the front-end and stores them in a data table named "history."
  • The history.php script retrieves the most recent 10 history records from the database and returns them in JSON format to the front-end.

The overall workflow is that the user inputs an expression in the front-end interface, then clicks the calculate button. The front-end uses an XMLHttpRequest object to send the expression to the server for calculation and display the result on the interface. At the same time, the front-end also sends the expression and result to the server for storage in the database. Finally, the front-end uses another XMLHttpRequest object to get the history record and update the history record list.

V. Personal Journey and Learnings

I learned how to link back and forth code and how to use the database, and use the XMLHttpRequest object to send expressions to the server for evaluation and display the results on the interface. At the same time, the front end also sends the expressions and results to the server for storage in the database.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 油水分离的前沿技术包括: 1. 超声波技术:通过高频声波在油水混合物中产生微小空泡,使油和水分离。 2. 动力学分离技术:通过油水混合物的物理性质,如密度、流动性等差异,将油和水分离。 3. 光学分离技术:利用油和水在光学特性上的差异,如光吸收、折射率等,将油和水分离。 4. 膜技术:通过膜的选择性透过性,将油和水分离。 5. 化学吸附技术:通过合适的化学吸附剂,吸附油,使油和水分离。 这些技术具有不同的优缺点,根据实际应用情况,应选择合适的技术。 ### 回答2: 油水分离的前沿技术是指在处理含油废水时使用的最新科技和方法。由于油污水的治理一直是一个全球性的环境问题,因此研究人员一直在努力开发更有效的方法来分离油水,以减少对环境的污染。 一种前沿技术是利用纳米材料进行油水分离。纳米材料具有大比表面积和特殊的化学和物理性质,可以吸附或分解油污染物。这种技术通过将纳米材料应用于分离设备中,可以高效地分离油水混合物。纳米材料的使用还可以提高设备的储油容量和改善处理效率。 另一种前沿技术是利用膜分离技术进行油水分离。膜分离技术利用特殊的膜材料将油和水分离开来。这种技术相对传统的方法具有更高的分离效率和选择性。同时,膜分离技术还可以实现连续操作和减少处理成本。 此外,一种新兴的技术是利用电化学方法进行油水分离。该方法通过电场效应使油和水分离开来。这种技术具有高效、环保和可控性的优势,可以有效地处理不同种类的油污染物。 总之,油水分离的前沿技术为解决油污染问题提供了新的方法和可能性。这些技术在提高分离效率、降低处理成本和减少环境污染方面具有重要意义,对于推动可持续发展和保护环境具有重要作用。 ### 回答3: 油水分离的前沿技术是一种用于将油和水分离的先进技术。油水分离是一项重要的环境工程技术,用于处理由油污染引起的水体和废水。过去,常用的油水分离方法包括重力分离、漂浮、离心分离等,但这些方法存在一些局限性。 随着科技的进步,油水分离的前沿技术不断涌现。一个前沿技术是电化学油水分离法。该技术利用电解作用将水中的油脂离子化,然后利用电极的特殊性质将油脂吸附并分离出来。这种方法具有高效、节能、环保等优点,可以有效地从废水中分离出油脂。 另一个前沿技术是膜分离技术。膜分离技术利用特殊的薄膜材料,如聚合物膜、陶瓷膜等,通过渗透、过滤和离子交换等机制实现油水分离。这种技术具有高效、节能、可持续等特点,可以有效地去除水中的油污染物。 此外,纳米技术也被应用于油水分离的前沿技术中。纳米材料具有巨大的比表面积和特殊的物理化学性质,可以用于油水分离膜、吸附材料等的制备。通过纳米材料的使用,油水分离的效率和效果能够得到显著提高。 总之,油水分离的前沿技术不断涌现,为处理油污染带来了新的可能性。电化学油水分离、膜分离技术和纳米技术等都是重要的前沿技术,将为环境保护和资源开发提供有力支持。随着科学技术的发展,我们可以期待更多创新的油水分离技术的出现。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值