Assignment 1 22BCE10697
Assignment 1 22BCE10697
<html>
<head>
</head>
<body>
<map name="alphabetMap">
</map>
</body>
</html>
OUTPUT
2) Develop an online application to find the transpose of the given
matrix. Obtain the number elements from the user based on the
number of rows and columns using JavaScript.
<html >
<head>
<title>Matrix Transpose</title>
<style>
body {
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
.container {
background: white;
padding: 20px;
border-radius: 10px;
text-align: center;
form {
margin-bottom: 20px;
input[type="number"] {
margin: 10px;
padding: 5px;
width: 50px;
button {
margin-top: 20px;
#matrixInput {
margin-top: 20px;
#matrixInput input {
width: 50px;
padding: 5px;
margin: 5px;
#result {
margin-top: 20px;
</style>
</head>
<body>
<div class="container">
<h1>Matrix Transpose</h1>
<form id="matrixForm">
<label for="rows">Rows:</label>
<label for="columns">Columns:</label>
</form>
<div id="matrixInput"></div>
</div>
<script>
function generateMatrix() {
matrixInputDiv.innerHTML = '';
input.type = 'number';
input.id = `matrix-${i}-${j}`;
input.required = true;
matrixInputDiv.appendChild(input);
matrixInputDiv.appendChild(document.createElement('br'));
document.getElementById('transposeButton').style.display = 'inline-block';
function transposeMatrix() {
row.push(parseInt(document.getElementById(`matrix-${i}-${j}`).value));
matrix.push(row);
}
row.push(matrix[j][i]);
transposedMatrix.push(row);
displayResult(transposedMatrix);
function displayResult(matrix) {
</script>
</body>
</html>
OUTPUT
<html>
<head>
<style>
body {
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
background: white;
padding: 20px;
border-radius: 10px;
text-align: left;
width: 400px;
.container h1 {
text-align: center;
form {
display: flex;
flex-direction: column;
label {
margin-top: 10px;
input, select {
margin-top: 5px;
padding: 10px;
font-size: 16px;
button {
margin-top: 20px;
font-size: 16px;
cursor: pointer;
background-color: #007BFF;
color: white;
border: none;
border-radius: 5px;
.error {
color: red;
font-size: 14px;
margin-top: 5px;
</style>
</head>
<body>
<div class="container">
<form id="registrationForm">
<label for="age">Age:</label>
<label for="gender">Gender:</label>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>
<label for="email">Email:</label>
<label for="address">Address:</label>
</form>
</div>
<script>
function validateForm() {
isValid = false;
} else {
nameError.textContent = '';
// Validate Age
const age = document.getElementById('age').value;
isValid = false;
} else {
ageError.textContent = '';
// Validate Gender
isValid = false;
} else {
genderError.textContent = '';
if (!phonePattern.test(phone)) {
isValid = false;
} else {
phoneError.textContent = '';
// Validate Email
if (!emailPattern.test(email)) {
isValid = false;
} else {
emailError.textContent = '';
// Validate Address
isValid = false;
} else {
addressError.textContent = '';
if (isValid) {
alert('Registration Successful!');
</script>
</body>
</html>
OUTPUT