Question: a) String manipulation is common in programming. It is used for example to do input validations, or simply change the nature of the String. Refer

 a) String manipulation is common in programming. It is used for

a) String manipulation is common in programming. It is used for example to do input validations, or simply change the nature of the String. Refer to Figure 1, assume that the user types in a text, and a number in the respective text fields. The user can then click on any of the available buttons and see the result in the Answer text field. If the user clicks 'reverse your system should reverse the text. 'Size' is to return the size of the text. "Repeat' will repeat the text according to the number they enter. If the user types in a negative number, display a warning message the Answer text field. The form submits back to the same page as a POST request. The three buttons are named btnReverse, btnSize, and btnRepeat. Write PHP script to demonstrate the action of those three buttons only. You do not need to write codes for the interface. (10 marks) b) You are simulating a simple calculator. Write PHP script to demonstrate the interface exactly as shown in Figure 2. By default, all text fields show 0. The form submits back to the same page, maths.php, as a POST request. After the user types in Number 1 and Number 2 in the Your Inputs section, the user should then click "Click Here". Then, your code should calculate accordingly and display the answer in the respective text fields in The Answer section. If the user enters 0 as Number 2 your system should display "Cannot Divide" in the Divide's text field. (20 marks)

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!