Android Web Technology ASSESSMENTS
Android Web Technology ASSESSMENTS
PSDA 01:-
Create a web page that will have separate links to show maps of India and
the World. When a user will open a map of India, create links to display the
information of each state i.e. highlighted in the map in a separate
window/document. (The information should be brief i.e. not more than 3-4
sentences.) When the user will open a world map, show the list of countries
on clicking the image in a new window.
Code:-
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Maps</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 0;
}
.container {
text-align: center;
margin-top: 50px;
}
.map-link {
margin: 10px;
padding: 10px 20px;
background-color: #007bff;
color: #fff;
text-decoration: none;
border-radius: 5px;
font-size: 18px;
transition: background-color 0.3s ease;
}
.map-link:hover {
background-color: #0056b3;
}
.country-link, .state-link {
display: inline-block;
margin: 10px;
padding: 10px 20px;
background-color: #007bff;
color: #fff;
text-decoration: none;
border-radius: 5px;
font-size: 18px;
transition: background-color 0.3s ease;
}
.country-link:hover, .state-link:hover {
background-color: #0056b3;
}
.map-section {
display: none;
padding: 20px;
}
.map-img {
max-width: 100%;
height: auto;
}
h1 {
color: #333;
}
h2 {
color: #555;
}
p{
color: #777;
}
</style>
</head>
<body>
<div class="container">
<a href="#" class="map-link" onclick="showMap('india-map')">India Map</a>
<a href="#" class="map-link" onclick="showMap('world-map')">World Map</a>
</div>
<script>
function showMap(mapId) {
var maps = document.getElementsByClassName('map-section');
for (var i = 0; i < maps.length; i++) {
maps[i].style.display = 'none';
}
document.getElementById(mapId).style.display = 'block';
}
function showStateInfo(stateId) {
showMap('state-info');
document.getElementById(stateId).scrollIntoView({ behavior: 'smooth', block: 'start' });
}
function showCountryInfo(countryId) {
showMap('country-info');
document.getElementById(countryId).scrollIntoView({ behavior: 'smooth', block: 'start' });
}
</script>
</body>
</html>
Output :-
PSDA 02:-
Input:-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Product Information</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
.container {
max-width: 800px;
margin: 20px auto;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
.product {
margin-bottom: 30px;
}
.product img {
max-width: 100%;
height: auto;
}
.product h2 {
margin-top: 10px;
color: #555;
}
.product a {
display: block;
text-align: center;
margin-top: 10px;
text-decoration: none;
color: #007bff;
font-weight: bold;
}
.details {
display: none;
}
</style>
</head>
<body>
<div class="container">
<h1>Product Information</h1>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const productLinks = document.querySelectorAll('.product a');
productLinks.forEach(function(link) {
link.addEventListener('click', function(event) {
event.preventDefault();
const productId = this.getAttribute('href').slice(1);
const detailsSections = document.querySelectorAll('.details');
detailsSections.forEach(function(section) {
section.style.display = 'none';
});
const productDetails = document.getElementById(productId);
productDetails.style.display = 'block';
});
});
});
</script>
</body>
</html>
Output :-
PSDA 03:-
Input:-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Indian Authors Manager</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
.container {
max-width: 800px;
margin: 20px auto;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
form {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
input[type="text"] {
flex: 1;
padding: 10px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type="submit"],
button {
padding: 10px 20px;
font-size: 16px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type="submit"] {
background-color: #007bff;
color: #fff;
transition: background-color 0.3s ease;
}
input[type="submit"]:hover {
background-color: #0056b3;
}
button.delete-btn {
background-color: #dc3545;
color: #fff;
}
button.delete-btn:hover {
background-color: #c82333;
}
ul {
list-style-type: none;
padding: 0;
}
li {
padding: 10px;
border-bottom: 1px solid #ccc;
}
li h3 {
margin-top: 0;
color: #333;
}
li p {
margin: 5px 0;
color: #666;
}
li.completed {
text-decoration: line-through;
color: #999;
}
</style>
</head>
<body>
<div class="container">
<h1>Indian Authors Manager</h1>
<form id="author-form">
<input type="text" id="author-input" placeholder="Add Author...">
<input type="text" id="books-input" placeholder="Best Books...">
<input type="text" id="published-input" placeholder="Books
Published...">
<input type="text" id="experience-input" placeholder="Years of
Experience...">
<input type="submit" value="Add Author">
</form>
<ul id="author-list"></ul>
</div>
<script>
const authorForm = document.getElementById('author-form');
const authorInput = document.getElementById('author-input');
const booksInput = document.getElementById('books-input');
const publishedInput = document.getElementById('published-input');
const experienceInput = document.getElementById('experience-input');
const authorList = document.getElementById('author-list');
authorForm.addEventListener('submit', function(e) {
e.preventDefault();
const authorName = authorInput.value.trim();
const bestBooks = booksInput.value.trim();
const booksPublished = publishedInput.value.trim();
const yearsExperience = experienceInput.value.trim();
if (authorName !== '') {
addAuthor(authorName, bestBooks, booksPublished,
yearsExperience);
authorInput.value = '';
booksInput.value = '';
publishedInput.value = '';
experienceInput.value = '';
}
});
function toggleAuthor() {
this.classList.toggle('completed');
}
function deleteAuthor() {
this.parentElement.remove();
}
</script>
</body>
</html>
Output:-
PSDA 04:-
Input:-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Popular Movies</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
.container {
max-width: 800px;
margin: 20px auto;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
ul {
list-style-type: none;
padding: 0;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
li {
margin: 10px;
width: 200px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
img {
width: 100%;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
.movie-info {
padding: 10px;
}
.movie-title {
font-weight: bold;
margin-top: 0;
}
.movie-rating {
color: #007bff;
}
</style>
</head>
<body>
<div class="container">
<h1>Popular Movies</h1>
<ul id="movie-list">
<!-- List of movies will be dynamically added here -->
</ul>
</div>
<script>
const movies = [
{
title: "Inception",
poster:
"https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRRyuWmayVBv
qjd1MxTKpRgauq2cCtUzb7Q9QvaFTkAuxAU_EYMoCE3wBuJeftxIzf0grreI
w",
rating: 8.8,
genre: "Action, Adventure, Sci-Fi",
year: 2010
},
{
title: "The Shawshank Redemption",
poster:
"https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSf1DK32xKMQz
qSl8wnY1BLVu_gdwsRYzVSNM6A03r6c-fEwrif8raKzkFRuerw1KHdDICvO
w",
rating: 9.3,
genre: "Drama",
year: 1994
},
{
title: "The Godfather",
poster:
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQAY2xsJVIZxm
3K0gNtOMr9CSCvLdr5kdo3V3pv2HMuUkTBhFzRe5-b8NDRmO1mt5S5X
p_YyQ",
rating: 9.2,
genre: "Crime, Drama",
year: 1972
},
{
title: "The Dark Knight",
poster:
"https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTfE_qrYMBZ_J
B8om-34WGaZARhpX26yWRttqIDvn4_7l--UzX8mxKcPrc59IcvTpEA_G8g
PA",
rating: 9.0,
genre: "Action, Crime, Drama",
year: 2008
}
];
movies.forEach(movie => {
const listItem = document.createElement("li");
const posterImg = document.createElement("img");
posterImg.src = movie.poster;
listItem.appendChild(posterImg);
listItem.appendChild(movieInfo);
movieList.appendChild(listItem);
});
</script>
</body>
</html>
Output:-