Implement the following calculator (e.g. +, -, *,1,%) based on the comments in 430.php template. Only the code written b

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Implement the following calculator (e.g. +, -, *,1,%) based on the comments in 430.php template. Only the code written b

Post by answerhappygod »

Implement The Following Calculator E G 1 Based On The Comments In 430 Php Template Only The Code Written B 1
Implement The Following Calculator E G 1 Based On The Comments In 430 Php Template Only The Code Written B 1 (16.65 KiB) Viewed 38 times
Implement the following calculator (e.g. +, -, *,1,%) based on the comments in 430.php template. Only the code written between the starting point and the ending point is treated as the valid code. Do not modify any code that is already there. Submit the implemented 430f initial.php.

O localhost/430/430fa.php NJCU Online Calculator Operator Selection

1 2 3 4 5 6 7 8 9 10 11 12 13 <html> <head> <title>Final</title> <?php $v1=null; $operator='Operator Selection'; $v2=null; $result=null; if (!isset($_POST['v1'])&&!isset($_POST['operator'])&&!isset($_POST['V2'])){ } else { if (1/*Write a boolean expression to replace the "1", which indicates if the user typed value1 and value2 are all numbers and operator is selected(10pts)*//*Staring Point*//*Er /*Assign the information collected from the form to $v1, $operator and $v2 correspondingly(10pts)*/ /*Staring Point*/ /*Ending Point*/ /*Write a switch-case section in order calculate the $result with $v1, $operator and $v2(10pts)*/ /*Staring Point*/ /*Ending Point*/ } else { /*Write a statement to output a JS alert window with the content of "Please enter two valid numbers and select an operator!"(10pts)*/ /*Staring Point*/ /*Ending Point*/ 14 15 16 17 18 19 20 21 22 23 24 25 }

26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 ?> </head> <body> <div class="container"> <!--Add a header element with the content of green color "NJCU Online Calculator" (10pts)--> <!--Staring Point--> <!--Ending Point--> <!--Add a opening tag of form element using "post" method and subbmitting the information of the form to cuttent php file(10pts) --> <!--Staring Point --> <!--Ending Point--> <input type="text" id="v1" name="v1" value="<?php echo $v1;?>"> <select id="operator" name="operator"> <!--Add an attribute for the option element in order to make itself as the default option element of the select element(10pts)--> <!--Staring Point--><option id="default" name="default"><!--Ending Point--> <!--Add the content of the option element in order to display the value of $operator using php(10pts) --> <!--Staring Point--> <!-- Ending Point--> </option> <!--Add the option elements in order to display +, -, *, 1, % operators (10pts)--> <!--Staring Point--> <!--Ending Point--> </select> <input type="text" id="v2" name="v2" value="<?php echo $v2;?>"> <input type="submit" value="="> <!--Add an html element in order to display the $result using php(10pts)--> <!--Staring Point--> <!--Ending Point--> </form> </div> <script> if (window.history.replaceState) { window.history.replaceState( null, null, window.location.href); } </script> </body> </html> 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply