0% found this document useful (0 votes)
5 views

webtech.file

The document contains various code snippets for creating a CV in HTML, a railway ticket reservation form with JavaScript validations, a JavaScript function to find the greatest common divisor, an ASP example for client/server-side scripting, and an XML DTD for a bookstore. Each section includes specific coding elements and requirements. The overall focus is on web development and programming practices.

Uploaded by

arunsangwal4123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

webtech.file

The document contains various code snippets for creating a CV in HTML, a railway ticket reservation form with JavaScript validations, a JavaScript function to find the greatest common divisor, an ASP example for client/server-side scripting, and an XML DTD for a bookstore. Each section includes specific coding elements and requirements. The overall focus is on web development and programming practices.

Uploaded by

arunsangwal4123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

1.Design a HTML page to display your CV .

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, ini al-scale=1.0">

< tle>My CV</ tle>

<style>

body {

font-family: Arial, sans-serif;

margin: 0;

padding: 20px;

.container {

max-width: 800px;

margin: 0 auto;

h1, h2, h3, h4, h5, h6 {

margin-top: 0;

.sec on {

margin-bo om: 20px;

.sec on h2 {

border-bo om: 1px solid #ccc;

padding-bo om: 5px;

.subsec on {

margin-le : 20px;

}
.subsec on h3 {
margin-top: 10px;

.subsec on ul {

margin-top: 5px;

margin-bo om: 10px;

</style>

</head>

<body>

<div class="container">

<header>

<h1>Arun Singh</h1>

<p>So ware Developer</p>

</header>

<sec on class="sec on">

<h2>Contact Informa on</h2>

<p>Email: [email protected]</p>

<p>Phone: 8083234530</p>

<p>Address: 123 Samba, Samba, India</p>

</sec on>

<sec on class="sec on">

<h2>Educa on</h2>

<div class="subsec on">

<h3>Bachelor of Science in Informa on Technology </h3>

<p>Harcourt Bu ler Technical University, Kanpur, India</p>

<p>Gradua on Year: 2023</p>

</div>

</sec on>

<sec on class="sec on">


<h2>Experience</h2>

<div class="subsec on">

<h3>So ware Developer</h3>

<p>Infosys, Pune, India</p>

<p>Date: August 1,2023 - Present</p>

<ul>

<li>Designing and crea ng so ware</li>

<li>So ware Tes ng</li>

</ul>

</div>

</sec on>

<sec on class="sec on">

<h2>Skills</h2>

<ul>

<li>Programming Languages: Java, Python, JavaScript</li>

<li>Frameworks: Spring, Django, React</li>

</ul>

</sec on>

<sec on class="sec on">

<h2>Languages</h2>

<ul>

<li>English (Fluent)</li>

<li>Spanish (Basic)</li>

</ul>

</sec on>

</div>

</body>

</html>
Output:
Arun Singh
Software Developer

Contact Information
Email: [email protected]

Phone: 8083234530

Address: 123 Samba, Samba, India

Education
Bachelor of Science in Information Technology

Harcourt Buttler Technical University, Kanpur, India

Graduation Year: 2023

Experience
Software Developer

Infosys, Pune, India

Date: August 1,2023 - Present

 Designing and creating software


 Software Testing

Skills
 Programming Languages: Java, Python, JavaScript
 Frameworks: Spring, Django, React
 Databases: MySQL, MongoDB

Languages
 English (Fluent)
 French (Intermediate)
2.Design a HTML form to reserve a railway cket.
<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, ini al-scale=1.0">

< tle>Railway Ticket Reserva on</ tle>

<style>

body {

font-family: Arial, sans-serif;

form {

max-width: 400px;

margin: 0 auto;

input[type="text"], input[type="date"], input[type="number"], select {

width: 100%;

padding: 10px;

margin: 5px 0;

box-sizing: border-box;

input[type="submit"] {

width: 100%;

background-color: #4CAF50;

color: white;

padding: 14px 20px;

margin: 8px 0;

border: none;

border-radius: 4px;

cursor: pointer;

}
input[type="submit"]:hover {

background-color: #45a049;

</style>

</head>

<body>

<h2>Railway Ticket Reserva on</h2>

<form ac on="submit_ cket.php" method="post">

<label for="name">Name:</label>

<input type="text" id="name" name="name" required>

<label for="email">Email:</label>

<input type="email" id="email" name="email" required>

<label for="phone">Phone:</label>

<input type="tel" id="phone" name="phone" required>

<label for="from">From:</label>

<input type="text" id="from" name="from" required>

<label for="to">To:</label>

<input type="text" id="to" name="to" required>

<label for="date">Date:</label>

<input type="date" id="date" name="date" required>

<label for="class">Class:</label>

<select id="class" name="class" required>

<op on value="economy">Economy</op on>


<op on value="business">Business</op on>

<op on value="first">First Class</op on>

</select>

<label for="passengers">Number of Passengers:</label>

<input type="number" id="passengers" name="passengers" min="1" required>

<input type="submit" value="Submit">

</form>

</body>

</html>
3.Write a Java Script program that finds the greatest
common divisor of two numbers.

func on gcd(a, b) {

if (a < b) {

[a, b] = [b, a];

while (b !== 0) {

let temp = b;

b = a % b;

a = temp;

return a;

// Test the func on

const num1 = 48;

const num2 = 18;

console.log(`The greatest common divisor of ${num1} and ${num2} is: ${gcd(num1, num2)}`);
Output:
The greatest common divisor of 48 and 18 is: 6
4.In the form of railway reservation of ticket add the
following validations using java script.
a. From city and to city are two different cities.
b. Age of passengers should not be greater than
150.
c. Name of passengers should be a string of
maximum length.

<!DOCTYPE html>
<html>
<head>
<title>Railway Ticket Reservation</title>
<script>
function validateForm() {
var fromCity = document.getElementById("fromCity").value;
var toCity = document.getElementById("toCity").value;
var age = parseInt(document.getElementById("age").value);
var name = document.getElementById("name").value;

// Validate if from city and to city are different


if (fromCity === toCity) {
alert("From city and to city should be different");
return false;
}

// Validate age
if (age > 150) {
alert("Age should not be greater than 150");
return false;
}

// Validate name length


if (name.length === 0 || name.length > 50) {
alert("Name should be a string of maximum length");
return false;
}

return true;
}
</script>
</head>
<body>
<h2>Railway Ticket Reservation</h2>
<form onsubmit="return validateForm()">
<label for="fromCity">From City:</label>
<input type="text" id="fromCity" name="fromCity"><br><br>

<label for="toCity">To City:</label>


<input type="text" id="toCity" name="toCity"><br><br>

<label for="age">Age:</label>
<input type="number" id="age" name="age"><br><br>

<label for="name">Name:</label>
<input type="text" id="name" name="name"><br><br>

<input type="submit" value="Submit">


</form>
</body>
</html>
5.Write a program for illustrating client/server-side
scripting with help of ASP.

<!DOCTYPE html>
<html>

<head>
< tle>ASP Client/Server Scrip ng Example</ tle>
</head>
<body>
<form ac on="example.asp" method="post">
Enter your name: <input type="text" name="name"><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
6. Write a piece of code in XML for creating DTD,
which specifies set of rules.

<!DOCTYPE bookstore [

<!ELEMENT bookstore (book*)>


<!ELEMENT book ( tle, author, genre, price)>
<!ELEMENT tle (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT genre (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ATTLIST book id ID #REQUIRED>
<!ATTLIST price currency CDATA #REQUIRED>
]>
<bookstore>
<book id="1">
< tle>Harry Po er and the Sorcerer's Stone</ tle>
<author>J.K. Rowling</author>
<genre>Fantasy</genre>
<price currency="USD">20.00</price>
</book>
<book id="2">
< tle>1984</ tle>
<author>George Orwell</author>
<genre>Dystopian</genre>
<price currency="GBP">15.00</price>
</book>
</bookstore>
Output:
J.K. Rowling Fantasy 20.00 George Orwell Dystopian 15.00

You might also like