Question

Write JSP programs which can perform the following tasks: (i) A page requires input of four variables a, b, c and d, it then computes and displays the value a*b/(c+d). In addition, the program must make sure that, in case there is division by zero error, it is reported. Write the JSP code for the above. (ii) Why are cookies created? Explain their use with the help of two cookies namely customerID and customername. The example should demonstrate the use of the cookie.

21 Jan 2021
Answer :
Word Count : 492

(i) To create a JSP page that takes inputs for four variables (a, b, c, and d), computes the result of a*b/(c+d), and handles division by zero errors, you can use the following code:

 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <html> <head> <title>Division Calculation</title> </head> <body> <h2>Enter Values for a, b, c, d</h2> <form action="" method="post"> a: <input type="text" name="a" required><br><br> b: <input type="text" name="b" required><br><br> c: <input type="text" name="c" required><br><br> d: <input type="text" name="d" required><br><br> <input type="submit" value="Calculate"> </form> <%  ________ ______ ____ ________ _____ ____ _____ _______ _______ _____.
___ __________ _____ _________ ___ _________ _________ ____ __________ ____ ________ ___.
______ ______ ______ ________ ______ _________.
_________ ______ __________ _______ ___ _______ ________.
_______ ___ ____ _________ ___ __________ _________ _________ ______ ________ ____.
_______ ______ _____ ____ ________ ____ ____ _______ ______ ______ _____.
____ _______ ___ _____ ______ _____ __________ _____ ________ _______ _____.
______ ________ ______ ________ ________.
_________ __________ _____ _____ _________ ___.
____ _______ _________ _______ _________.
__________ ____ __________ ________ _______ _______ ________ _____.
__________ _______ _________ ________ ___ ____ _____ ________ ____ ________ _____.
______ __________ _________ ________ _______ ______.
______ __________ _________ _______ ________ ____ _______ ___ __________ _________.
____ ________ ____ ___ _____ _____ __________.
_________ ________ __________ _________ ______ ___.
_____ ________ _________ _____ _______ ____.
___ _________ ___ ___ ___ ______ ______ ___ ___ _______.
___ ______ ________ ______ _____ _________ ____ __________ ________ ________ ___.
_____ ____ ____ ____ ________ ________ _______ __________.
___ ______ ________ _____ ______ _______.
____ ______ __________ ____ ______ ___ ___ __________ ______.
________ _____ ________ ______ _____.
________ ____ _____ ____ _______ ________ _________ _____ __________ ____ ____ _______.
________ _______ _______ __________ _____ __________.
___ ____ _______ _________ _______ _______ ________ _____ _______.
_______ __________ ______ ________ _______ __________ _________ _______ _______ _________ ________.
____ ______ _________ ______ __________ ______ _________ _______ _____ ________.
_________ ________ _____ _________ _____ __________ ________.
____ _________ _____ _________ ___ _____ ___ ___.
_________ ________ __________ _____ __________ _____ _______ _____ _________ ________ ___ ____.
____ ____ ______ _____ __________ _______ ______ ____ __________ ________ ____ _______.
______ _____ _____ ________ ___ ___ _______ ___ _____ ______.
_________ ________ ________ _________ _____ _________.
_________ ____ ________ ________ _____.
____ ______ _____ ________ ___.
________ _______ ________ _________ ________ _____ ______ _____ _________ ____ _______.
__________ _____ ________ ______ ___ _________ __________ ______ _________.
________ _______ _____ __________ _______ ______ __________ ________.
______ ___ ___ _______ ____ ________ ___ ________ ______ ____ _____.
_____ _____ _________ _________ _____ ____ ____ _____ _______.
___ ___ _________ _________ __________ ___ _________ __________.
______ __________ ________ _________ ________ ____ _____ ___ ________ _________ ___ __________.
______ ______ ______ _______ ____ ___ ______ _________ _____ ________ __________.
_________ _______ _________ _________ __________ _______ ________ ______.
_______ ___ __________ _____ ______.
__________ ________ ___ ___ _________ _______.
________ __________ _________ __________ ________ ________ _______ _____.
____ ________ ________ ____.
Get Full Answer on WhatsApp
IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Write JSP programs which can perform the following tasks: (i) A page r
🟢
WhatsApp Chat Fast live messaging
Email Us Business enquiries & support