Professional Documents
Culture Documents
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Your_Name - Curriculum Vitae</title>
</head>
<body>
<header>
<h1>Your_Name</h1>
<p>Email | Mobile</p> <p>Address | <a
href="https://www.linkedin.com/in/ ">LinkedIn</a> </p>
</header>
<section class="section">
<h2>Languages</h2>
<p>English, Hindi</p>
</section>
<section class="section">
<h2>Skills</h2>
<pre>C++ Programming
Python Programming
C Programming
Front End Development
Data Structures and Algorithm</pre>
</section>
<section class="section">
<h2>Interests</h2>
<p>Hackathons and Coding Competition, Quizzes and Challenges, Fitness, Sketching,
Travelling</p>
</section>
<section class="section">
<h2>Certificates</h2>
<pre>C++ Programming,
Data Structure and Algorithm,
1|Page
Front-End Development
Python Programming</pre>
</section>
<section class="section">
</section>
</body>
</html>
2|Page
2. Create student registration form for an Institute using HTML.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Student Registration Form</title>
<style> body
{
font-family: Arial, sans-serif;
margin: 20px;
} label {
display: block;
margin-bottom: 5px;
}
textarea { width:
100%; padding: 8px;
margin-bottom: 10px;
border-radius: 5px;
border: 1px solid #ccc;
}
input[type="submit"] {
padding: 10px 20px;
background-color: #007bff;
color: white; border:
none; border-radius:
5px; cursor: pointer;
}
input[type="submit"]:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
</body>
</html>
4|Page
3. Write a program in java to sort the given String array
alphabetically. name [ ] = {“Madras”, ”Delhi”,
”Ahmedabad”, ”Calcutta”,
”Bombay”};
import java.util.Arrays;
OUTPUT :-
Sorted Array:
Ahmedabad
Bombay
Calcutta
Delhi
Madras
5|Page
4. Write a Program in java to create a package Mops that consists of
mathematical operations like addition, subtraction, division,
modulus and multiplication as methods of class MathOps and use it
in another java file.
MathOps.java (inside the Mops package):
package Mops;
MainProgram.java (another Java file where you use the MathOps class):
import Mops.MathOps;
// Displaying results
System.out.println("Addition: " + resultAddition);
System.out.println("Subtraction: " + resultSubtraction);
System.out.println("Division: " + resultDivision);
System.out.println("Modulus: " + resultModulus);
System.out.println("Multiplication: " + resultMultiplication);
}
}
7|Page
5. Write a program using JavaScript to display browser information.
<!DOCTYPE html>
<html>
<head>
<title>Browser Information</title>
<script>
function displayBrowserInfo()
{
document.getElementById("browserInfo").innerHTML =
"<strong>Browser Name:</strong> " + navigator.appName + "<br>" +
"<strong>Browser Version:</strong> " + navigator.appVersion + "<br>" +
"<strong>Platform:</strong> " + navigator.platform + "<br>" +
"<strong>User Agent:</strong> " + navigator.userAgent + "<br>" +
"<strong>Cookies Enabled:</strong> " + navigator.cookieEnabled + "<br>";
}
</script>
</head>
<body>
<h1>Browser Information</h1>
<button onclick="displayBrowserInfo()">Display Browser Info</button>
<div id="browserInfo"></div>
</body>
</html>
8|Page
6. Create a calculator using HTML, CSS and JavaScript.
<!DOCTYPE html>
<html>
<head>
<title>Calculator</title>
<style>
#calculator { width:
300px;
margin: 0 auto;
}
.display {
width: 100%; height:
50px; text-align: right;
font-size: 20px;
}
<script>
const display = document.querySelector('.display');
const buttons = document.querySelectorAll('.buttons button');
10 | P a g e
7. Write JavaScript to validate the following fields of the
Registration page.
1. First Name and Last Name should contain alphabets and must
not be empty
2. Password must not be less than 6 characters length.
3. E-mail id (should not contain any invalid and must follow the
standard pattern
4. Example name@domain.com)
5. Mobile Number (Phone number should contain 10 digits only).
6. Address should not be Empty.
<!DOCTYPE html>
<html>
<head>
<title>Registration Page</title>
<script>
function validateRegistration() {
var firstName = document.getElementById('firstName').value; var
lastName = document.getElementById('lastName').value; var
password = document.getElementById('password').value; var
email = document.getElementById('email').value; var mobile =
document.getElementById('mobile').value; var address =
document.getElementById('address').value;
if (password.length < 6) {
alert('Password must be at least 6 characters long.'); return
false;
}
11 | P a g e
if (!emailRegex.test(email)) {
alert('Invalid Email format. Please enter a valid email.'); return
false;
}
if (!mobileRegex.test(mobile)) {
alert('Mobile number should contain 10 digits only.'); return
false;
}
12 | P a g e
8. Writing program in XML for creation of DTD, which specifies set
of rules.
<!DOCTYPE bookstore [
<!ELEMENT bookstore (book+)>
<!ELEMENT book (title, author, genre, price)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT genre (#PCDATA)>
<!ELEMENT price (#PCDATA)>
]>
<bookstore>
<book>
<title>Sample Book Title</title>
<author>John Doe</author>
<genre>Fiction</genre>
<price>19.99</price>
</book>
<book>
<title>Another Book Title</title>
<author>Jane Smith</author>
<genre>Non-fiction</genre>
<price>24.95</price>
</book>
</bookstore>
13 | P a g e
9. Write a java program/servlet/JSP to connect database and
create a table customer_info and insert the following records in it.
CustomI Customer_Nam Last_Nam Ag Countr
D e e e y
C101 Shankaran Pillai 29 India
C102 John Doe 25 US
C103 David Robinson 28 UK
import java.sql.*;
14 | P a g e
System.out.println("Inserting records into the table...");
sql = "INSERT INTO customer_info VALUES " +
"('C102', 'John', 'Doe', 25, 'US'), " + "('C103', 'David', 'Robinson', 28, 'UK')";
stmt.executeUpdate(sql);
15 | P a g e
10. Write a java program/servlet/JSP to connect database and
extract data from the table customer_info (ref: Practical 9) and
display them.
import java.sql.*;
static final String JDBC_DRIVER = " com.mysql.jdbc.Driver "; // JDBC driver for your
database
static final String DB_URL = "jdbc:mysql://localhost/your_database"; // Database
URL
try {
// Register JDBC driver
Class.forName(JDBC_DRIVER);
// Open a connection
System.out.println("Connecting to database...");
conn = DriverManager.getConnection(DB_URL, USER, PASS);
// Displaying data
while (rs.next()) {
String customID = rs.getString("CustomID");
String customerName = rs.getString("Customer_Name");
String lastName = rs.getString("Last_Name"); int
age = rs.getInt("Age");
String country = rs.getString("Country");
16 | P a g e
System.out.println("CustomID: " + customID);
System.out.println("Customer Name: " + customerName);
System.out.println("Last Name: " + lastName);
System.out.println("Age: " + age);
System.out.println("Country: " + country);
System.out.println("-----------------------");
}
rs.close();
17 | P a g e