Jawaharlal Nehru Technological University Hyderabad
Jawaharlal Nehru Technological University Hyderabad MCA 2021 WEB TECHNOLOGIES Previous Question Paper (July/August - 2021 - R17)
Answer any five questions
All questions carry equal marks
Main
Write a PHP function that reads three numbers and find the least of the three.
Answer
To find the minimum of three numbers in PHP, you can use a function that utilizes conditional statements or the built-in min() function.
function findLeast($a, $b, $c) {
return min($a, $b, $c);
}
// Example usage:
echo findLeast(10, 5, 8); // Outputs 5Write a program to connecting to database and executing simple queries in PHP.
Answer
The following PHP script demonstrates how to connect to a MySQL database using the MySQLi extension and execute a simple SELECT query.
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "test_db";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT id, name FROM users";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "ID: " . $row["id"] . " - Name: " . $row["name"] . "<br>";
}
} else {
echo "0 results";
}
$conn->close();Design a PHP form as below. The cost of the Aurdino Uno is 600 Rs, Wifi Module 300 Rs and Bluetooth is 300 Rs. Based on the user input calculate the amount payable and display it in Amount payable textbox when submit is clicked.(refer same page)
Answer
Sign in to view the complete answer paper.
Explain parsing XML data using SAX parser.
Answer
Sign in to view the complete answer paper.
Check whether the given xml is well formed and valid or not using DTD.
<?xml version="1.0"?>
<list>
<faculty>
<firstname>Anupama</firstname>
<secondname>Namburu</secondname>
<designation>Asso professor</designation>
<message>Don't forget the class this Saturday!</message>
</faculty>
<faculty>Answer
Sign in to view the complete answer paper.
Write a servlet program that reads two numbers form client and responds back to client with the prime numbers between first and second number.
Answer
Sign in to view the complete answer paper.
Explain the lifecycle of a Servlet.
Answer
Sign in to view the complete answer paper.
Write a note on scope of variables in java script.
Answer
Sign in to view the complete answer paper.
Differentiate between Servlets and JSP.
Answer
Sign in to view the complete answer paper.
Write a JSP program to demonstrate the use of cookies.
Answer
Sign in to view the complete answer paper.
Explain the usage of Beans in JSP.
Answer
Sign in to view the complete answer paper.