Question: This is the assignment: Create an HTML form for taking numeric values. Create a PHP script that receives the form data, performs some calculations, formats

This is the assignment:

Create an HTML form for taking numeric values. Create a PHP script that receives the form data, performs some calculations, formats the values, and prints the results. Format a floating point with 2 decimal places and another with 3 decimal places. The HTML is what the calculator should look like, it's the PHP code that I need assistance with.

Here is my HTML:

Calculator

Please complete this form:

Add: +

Multiply: *

Divide: /

Subract: -

Here is my PHP:

Product Cost Calculator

// Calculate the total: $add = $add1 + $add2; $multiply = $multiply1 * $multiply2; $divide = $divide1 / $divide2 $subract = $subract1 - $subract2

// Apply proper formatting: $multiply = number_format($multiply, 2); $divide= number_format($divide, 3);

// Print out results: print "

$add + $add1 .

";

?>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!