IT3511 FSWD Manual Record
IT3511 FSWD Manual Record
B-Tech – IT
LAB MANUAL
Prepared By
Dr. G. A. SENTHIL
SYLLABUS
Course Objective:
● To develop full stack applications with clear understanding of user interface, business logic and data
storage.
● To design and develop user interface screens for a given scenario
● To develop the functionalities as web components as per the requirements
● To implement the database according to the functional requirements
● To integrate the user interface with the functionalities and data storage.
List of Experiments:
Develop a portfolio website for yourself which gives details about yourself for a potential recruiter.
1. Develop a portfolio website for yourself which gives details about yourself for a potential
recruiter.
2. Create a web application to manage the TO-DO list of users, where users can login and
manage their to-do items
3. Create a simple micro blogging application (like twitter) that allows people to post their
content which can be viewed by people who follow them.
4. Create a food delivery website where users can order food from a particular restaurant
listed in the website.
5. Develop a classifieds web application to buy and sell used products.
6. Develop a leave management system for an organization where users can apply different
types of leaves such as casual leave and medical leave. They also can view the available
number of days.
7. Develop a simple dashboard for project management where the statuses of various tasks
are available. New tasks can be added and the status of existing tasks can be changed
among Pending, InProgress or Completed.
8. Develop an online survey application where a collection of questions is available and users are
asked to answer any random 5 questions.
Course Outcome:
CO1:Design full stack applications with clear understanding of user interface, business logic and data
storage.
CO2: Design and develop user interface screens CO3: Implement the functional requirements using
appropriate tool
CO4: Design and develop database based on the requirements
CO5 Integrate all the necessary components of the application
INDEX
Develop a portfolio website for yourself which gives details about yourself for a
1 potential Recruiter.
Create a web application to manage the TO-DO list of users, where users can login
2. and manage their to-do items.
Create a simple micro blogging application (like twitter) that allows people to post
3. their content which can be viewed by people who follow them.
Create a food delivery website where users can order food from a particular restaurant
4. listed in the website.
Develop a leave management system for an organization where users can apply
6 different types of leaves such as casual leave and medical leave. They also can view
the available number of days.
Develop a simple dashboard for project management where the statuses of various
7 tasks are available. New tasks can be added and the status of existing tasks can be
changed among Pending, InProgress or Completed.
ALGORITHM:
1. Define Purpose and Audience: Determine the purpose of your site and identify your target audience.
2. Choose Domain and Hosting: Select a domain name that represents you and a hosting service to make
your site accessible on the internet.
3. Select a Platform or Build from Scratch: Choose a website builder (e.g., WordPress, Wix) or build
your site from scratch using HTML, CSS, and JavaScript.
4. Design and Layout: Create a layout, design, and color scheme that reflects your style and is user-
friendly.
5. Content Creation: Write compelling content about yourself, including a bio, skills, experiences, and
projects.
6. Create Portfolio Sections: Showcase your work with images, videos, or demos.
7. Implement Contact Information: Provide contact details or a form for visitors to reach you.
8. Optimize for SEO: Incorporate keywords, meta tags, and descriptions for better search engine
visibility.
9. Mobile Responsiveness: Ensure your website looks good and functions well on mobile devices.
Test and Launch: Thoroughly test the website before launching it to ensure it works properly.
PROGRAM :
HTML (index.html):
<DOCTYPE html>
<deal long="en">
<head>
<meta charset="UTF-8">
<</head>
<body>
<header>
<nav>
<ul>
<li><a href="#home">Home</a>
<li><a href="#about>About</a></i>
<li><a href="#resume">Resume</a></li>
<li><a href="#portfolio">Portfolio</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<section id="home">
<h1>Your Name</h1>
</section>
<section id="about">
<h2>About Me</h2>
<p>Write a brief description about yourself and your professional background.</p> </section>
<section id="resume">
<h2>Resume</h2>
</section>
<section id="portfolio">
<h2>Portfolio</h2>
<p>Highlight your projects and provide descriptions and links to view them.</p>
<div class="project">
<h3>Project Title</h3>
</div>
<!-Add more project divs as needed ->
</section>
<section id="contact">
<h2>Contact</h2>
<ul>
<li>Email: [email protected]</li>
<li>Phone: 123-456-7890</li>
</ul>
</section>
<script src="script.js"></script>
</body>
</html>
CSS (styles.css):
nav ul li a {
section h2 {
margin-bottom: 20px; }
section p {
margin-bottom: 20px; }
section a {
display: inline-block; padding: 10px 20px; background-color: #333; color: #fff; text-decoration: none;
border-radius: 5px;
/* Project styles */ project ( margin-bottom: 30px; }
project h3 {
margin-bottom: 10px;
/* Responsive styles */ @media screen and (max-width: 600px) { section { padding: 30px; } }
OUTPUT:
RESULT: To Develop a portfolio website is successfully created
Ex. No: 2
CREATE A WEB APPLICATION TO MANAGE THE TO-DO
Date: LIST OF USERS WHERE USERS CAN LOGIN AND
MANAGE THEIR TO-DO ITEMS
AIM:
To Create a web application to manage the TO-DO list of users where users can login and
manage their to-do items
ALGORITHM:
The step-by-step process to implement the to-do list web application is given as follows -
1. Setup:
- Choose a web development framework and programming language.
- Set up your development environment.
2. Database:
- Choose a database system and create tables for users and to-do items.
3. User Authentication:
- Implement user registration and login.
4. Create To-Do Items:
- Create an interface for adding to-do items.
- Store items in the database linked to the user.
5. View, Update, and Delete:
- Develop pages to view, update, and delete to-do items.
6. User Interface:
- Design a user-friendly interface using HTML, CSS, and JavaScript or a front-end framework.
7. Security:
- Implement security measures to protect user data.
8. Testing:
- Thoroughly test the application, fixing any bugs.
9. Deployment:
- Deploy the app to a production server or cloud platform.
10. Scaling and Maintenance:
- Monitor and optimize performance.
- Regularly maintain and update the app.
11. User Support:
- Provide user support and documentation.
This condensed algorithm should give you a quick overview of the key steps in building your to-do list web
application.
PROGRAM:
HTML (index.html):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous">
<script src="app.js"></script>
<title>To Do List</title>
</head>
<body>
<header class="bg-success text-white p-5">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<font face="Comic sans MS" size="11" color="black">
<strong>ToDo List</strong>
</font>
</div>
</div>
</div>
</header>
<form id="addForm">
<div class="row">
<div class="col-lg-7 col-md-7 col-sm-7">
<h3 class="mt-4">Tasks</h3>
<form id="addForm">
<ul class="list-group" id="items"></ul>
</form>
</div>
</body>
</html>
<script>
window.onload = () => {
const form1 = document.querySelector("#addForm");
form1.addEventListener("submit", addItem);
items.addEventListener("click", removeItem);
};
function addItem(e) {
e.preventDefault();
if (submit.value != "Submit") {
console.log("Hello");
editItem.target.parentNode.childNodes[0].data
= document.getElementById("item").value;
submit.value = "Submit";
document.getElementById("item").value = "";
document.getElementById("lblsuccess").innerHTML
= "Text edited successfully";
document.getElementById("lblsuccess")
.style.display = "block";
setTimeout(function() {
document.getElementById("lblsuccess")
.style.display = "none";
}, 3000);
return false;
}
let li = document.createElement("li");
li.className = "list-group-item";
deleteButton.className =
"btn-danger btn btn-sm float-right delete";
deleteButton.appendChild(document.createTextNode("Delete"));
let editButton = document.createElement("button");
editButton.className =
"btn-success btn btn-sm float-right edit";
editButton.appendChild(document.createTextNode("Edit"));
li.appendChild(document.createTextNode(newItem));
li.appendChild(deleteButton);
li.appendChild(editButton);
items.appendChild(li);
}
function removeItem(e) {
e.preventDefault();
if (e.target.classList.contains("delete")) {
if (confirm("Are you Sure?")) {
let li = e.target.parentNode;
items.removeChild(li);
document.getElementById("lblsuccess").innerHTML
= "Text deleted successfully";
document.getElementById("lblsuccess")
.style.display = "block";
setTimeout(function() {
document.getElementById("lblsuccess")
.style.display = "none";
}, 3000);
}
}
if (e.target.classList.contains("edit")) {
document.getElementById("item").value =
e.target.parentNode.childNodes[0].data;
submit.value = "EDIT";
editItem = e;
}
}
</script>
OUTPUT
RESULT
Thus, the web application to manage the TO-DO list of users where users can login and
manage their to-do items has crated Successfully.
Ex. No: 3 . CREATE A SIMPLE MICRO BLOGGING
APPLICATION (LIKE TWITTER)
Date:
AIM:
Create a simple micro blogging application (like twitter) that allows people to post
their content which can be viewed by people who follow them
PROCEDURE :
● Post Creation & Viewing: Develop posting and feed viewing functionalities.
● Frontend Development: Use HTML, CSS, and JavaScript to build the user interface.
● Iterate and Improve: Gather feedback and continuously enhance the application.
PROGRAM :
HTML. (index.html).
<DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content" width=device-width, initial-scale=10">
<link rel="stylesheet" href="styles.css">
body{
font-family: Arial, sans-serif;
}
.container
{max-width: 600px; margin: 0 auto; padding: 20px;
}
hl {
text-align: center;
}
form textarea ( display: block; width: 100%; padding: 10px; margin-bottom: 10px;}
form button ( display: block; width: 100%; padding: 10px; background-color: #4CAF50;
color: #fff; border: none; cursor: pointer;}
#feed{
margin-top: 20px;
JavaScript (script.js):
document.addEventListener("DOMContentLoaded", function() {
OUTPUT:
RESULT:
Thus, the micro blogging application (like twitter) that allows people to post their content
which can be viewed by people who follow them is created successfully.
Ex. No: 4
CREATE A FOOD DELIVERY WEBSITE WHERE USERS CAN ORDER FOOD
FROM A PARTICULAR RESTAURANT FETED IN THE WEBSITE
Date:
AIM :
Create a food delivery website where users can order food from a particular restaurant feted
in the website
ALGORITHM:
Creating a food delivery website with the ability for users to order food from specific restaurants
involves several key components and algorithms.
HTML (index.html):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link
href="https://fonts.googleapis.com/css2?
family=Ubuntu+Mono&display=swap"
rel="stylesheet">
</head>
<body>
<header>
<h1 id="top">Online</h1>
<h1 id="top1">FoodShop</h1>
</header>
<hr>
<nav id="navbar">
<img src="5.jpeg">
<ul id="navcontent">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Menu</a></li>
<li><a href="contact.html">ContactUs</a></li>
</ul>
</nav>
<div id="container1">
<div id="row1">
Welcome to Online FoodShop
</div>
<button class="btn">ORDER NOW</button>
<div id="container3">
<div id="row2">
<button class="btn">Prices</button>
</div>
<div id="row3">
<button class="btn">Specials</button>
</div>
</div>
</div>
<hr>
<h1 id="top3">Featured Products</h1>
<div id="container4">
<div id="row4">
<button class="btn">ORDER NOW</button>
</div>
<div id="row5">
<button class="btn">ORDER NOW</button>
</div>
<div id="row6">
<button class="btn">ORDER NOW</button>
</div>
</div>
<footer>Copyright © 2020-2021 OnlineFoodShop.
All Rights are reserved</footer>
</body>
</html>
CONTACT.HTML:
The following HTML code describes us what contents are present in the “ContactUs” tab in the navigation
bar. We have used input tags to enter the type of “query”, “name”, “email-id”, “phone number” and
“explanation” of the query. We have also used radio buttons to enquire about the customer’s membership
for “online FoodShop “. The form also provides “Submit” and “Reset” buttons.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content=
"width=device-width, initial-scale=1.0">
STYLE.CSS:
This is the stylesheet block which gives us the proper look of the webpage.
Header styling: It consists of two “head” tags. We have used font-style “Ubuntu” to style the header and
we also used proper colors to make some text look attractive.
Navigation bar styling: It basically consists of logo styling and content styling. First of all we have
considered the navigation bar as a flexbox and assigned the flex-direction to “column”. We have centered
the logo image by display:block. We have used the margin:auto property to center the image. Then we
considered the content of the navigation bar as a flexbox and then we have positioned it properly.
Background image styling: We used before pseudo selectors to set the respective background images.
/*CSS Reset*/
*{
margin:0px;
padding:0px;
}
/*Header Styling*/
#top{
color:rgb(245, 10, 10);
text-align:center;
font-size:46px;
font-family: 'Ubuntu Mono', monospace;
}
#top1{
text-align:center;
color:black;
font-size:21px;
font-family: 'Ubuntu Mono', monospace;
}
/* Navigation bar styling*/
/*Navbar Functionality*/
#navbar{
display:flex;
flex-direction: column;
background-color: gray;
height: 14vh;
width: 100vw;
font-family: 'Ubuntu Mono', monospace;
margin-top:10px;
border: 2px solid black;
border-radius:15px;
}
#navcontent{
display: flex;
justify-content: center;
}
/*Navbar content styling*/
ul li{
list-style: none;
margin: 15px;
border-radius: 20px;
}
ul li a{
padding: 1px;
color:white;
text-decoration: none;
border-radius:10px;
}
ul li a:hover{
background-color: red;
border-radius: 10px;
}
margin-left: 38px;
border-radius: 40px;
}
#row3::before{
content: '';
background: url('3.jpeg') no-repeat center center/cover;
position: absolute;
top:0px;
left:0px;
width: 24vw;
height:21vh;
z-index: -1;
border-radius: 40px;
}
#top3{
text-align: center;
color:red;
font-family: 'Ubuntu Mono', monospace;
}
#container4{
display: grid;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
margin: 41px;
}
#row4{
width: 29vw;
height: 360px;
border: 2px solid black;
background:url('a1.jpeg') no-repeat center center/cover;
display: flex;
justify-content:center;
align-items:flex-end;
border-radius: 15px;
}
#row5{
width: 29vw;
height: 360px;
border: 2px solid black;
background:url('a2.jpeg') no-repeat center center/cover;
display: flex;
justify-content:center;
align-items:flex-end;
border-radius: 15px;
}
#row6{
width: 30vw;
height: 360px;
border: 2px solid black;
background:url('a3.jpeg') no-repeat center center/cover;
display: flex;
justify-content:center;
align-items:flex-end;
border-radius: 15px;
}
/*Designing the footer*/
footer{
text-align: center;
}
/*Designing of Contact Us*/
#ContactUs{
width:100vw;
height:100vh;
display:flex;
flex-direction: column;
align-items: center;
background-color: gray;
}
.form-shape input, .form-shape select, .form-shape textarea{
width: 92%;
padding: 0.5rem;
}
/*Changing the color of placeholder*/
::placeholder{
color:gray;
}
/*Making the webpage responsive using media queries*/
@media only screen and (max-width:1131px){
#row4{
width: 42vw;
}
#row5{
width:45vw;
}
#row6{
margin-top: 20px;
width:90vw;
}
}
@media only screen and (min-width:600px) and (max-width:781px)
{
#row4{
width:84vw;
margin: auto;
margin-left: 22px;
}
#row5{
width:84vw;
margin: auto;
margin-top: 20px;
margin-left: 22px;
}
#row6{
width:84vw;
margin: auto;
margin-top: 20px;
margin-left: 22px;
}
}
@media only screen and (max-width:600px){
#row4{
width:78vw;
margin: auto;
margin-left: 3px;
}
#row5{
width:78vw;
margin: auto;
margin-top: 20px;
margin-left: 3px;
}
#row6{
width:78vw;
margin: auto;
margin-top: 20px;
margin-left: 3px;
}
}
@media only screen and (min-height:1000px){
#navbar{
height:10vh;
}
#container1::before{
height:39vh;
}
#container1{
height:44vh
}
}
OUTPUT:
RESULT:
Thus Web Application of a food delivery website where users can order food from a
particular restaurant feted in the website is created successfully.
Ex. No: 5
DEVELOP A CLASSIFIEDS WEB APPLICATION TO BUY AND
Date: SELL USED PRODUCTS
AIM:
ALGORITHM:
Developing a classifieds web application for buying and selling used products involves multiple components
and steps.
1. Requirements Gathering:
- Define the core features and functionality of your classifieds platform.
- Understand user needs and expectations.
- Create a list of categories for products (e.g., electronics, vehicles, clothing).
2. Technology Stack:
- Choose the technology stack for your web application (e.g., front-end, back-end, and database
technologies).
3. Database Design:
- Design a database schema to store user accounts, product listings, categories, and user interactions.
- Choose a relational database system (e.g., MySQL, PostgreSQL).
5. Product Listing:
- Allow users to create and manage product listings.
- Include fields for title, description, price, category, location, and images.
7. Messaging System:
- Enable messaging between buyers and sellers.
- Implement real-time chat or email notifications.
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<header>
</header>
<main>
<div class="create-ad">
<h2>Create Ad</h2>
<form id="adForm">
</div>
</div>
</main>
<script src="script.js"></script>
</body>
</html>
Styles.css
.create-ad input[type="text"];
width 100%,
create-ad button {
display: block;
width: 100%;
padding: 10px;
background-color: #4CAF50,
color: #fff
border: none;
cursor: pointer,
ads (
margin-top: 20px;
ad (
padding 10px,
background-color: #f5f5f5;
margin-bottom: 10px;
Script.js:
document.addEventListener("DOMContentLoaded", function() {
adForm.addEventListener('submit', function(e) {
e.preventDefault();
const title =document.getElementById("adTitle").value;
const description= document.getElementById("adDescription").value;
const newAd=document.createElement('div');
newAd.classList.add("ad");
newAd.innerHTML="
<h3>${title}</h3>
<p>${description}</p>
adsContainer.appendChild(newAd);
OUTPUT:
RESULT:
Thus the Web application developing a classifieds web application for buying and selling used products
involves multiple components and steps has created successfully.
Ex. No: 6
DEVELOP A LEAVE MANAGEMENT SYSTEM FOR AN
Date: ORGANIZATION
AIM:
To Develop a leave management system for an organization where users can apply different types
of leaves such as casual leave and medical leave. They also can view the available number of
days
ALGORITHM:
Developing a leave management system involves several steps and can be quite complex, but here's
a high-level algorithm to get you started:
PROGRAM:
Create a server.js file in the root folder and copy this into the empty file.
const express = require("express");
const app = express();
const port = process.env.PORT || 3000;
const vm = require("v-response");
const morgan = require('morgan');
const mongoose = require("mongoose")
app.use(express.json());
app.use(morgan('dev'));
const database = 'mongodb://localhost:27017/levemanagementdb';
mongoose.connect((database), {
useUnifiedTopology: true,
useFindAndModify: false,
useNewUrlParser: true,
useCreateIndex: true,
})
.then(async () => {
vm.log("connected to database", database);
})
.catch(err => vm.log("error mongodb", err));
The server.js file will start up our Nodejs server to run this you can type this to your terminal
node server.js
auth.validation.js:
'use strict';
const Validator = require("validatorjs");
};
const validator = new Validator(obj, rules);
return {
errors: validator.errors.all(),
passed: validator.passes(),
}
},
};
auth.controller.js
//CREATE ACCOUNT
exports.CreateAccount = async (req, res, next) => {
try {
let obj = req.body;
const validateUserInput = await UserValidator.validateAccount(obj);
if (!validateUserInput.passed) {
return res.status(400)
.json({
status: false,
code: 400,
message: "There's error in your inputs",
errors: validateUserInput.errors,
})
}
const checkUserEmail = await User.findOne({email: req.body.email})
if (checkUserEmail) {
return res.status(409)
.json(vm.ApiResponse(false, 409, 'email already exist'))
} else if (!checkUserEmail) {
_.extend(obj, {
password: await vm.hashedPassword(obj.password, 10),
});
const account_object = await new User(obj);
const saveAccount = await account_object.save();
if (!saveAccount) {
return res.status(400)
.json(vm.ApiResponse(false, 400, "Oops! an error occurr"))
} else {
saveAccount.password = null;
return res.status(201)
.json(vm.ApiResponse(true, 200, `account created`, account_object));
}
}
} catch (e) {
return next(e);
}
}
//LOGIN
exports.login = async (req, res, next) => {
try {
const checkEmail = await User.findOne({email: req.body.email});
if (!checkEmail) {
return res.status(400)
.json(vm.ApiResponse(false, 400, 'email not found'))
} else {
const compareEmail = vm.comparepassword(checkEmail.password, req.body.password);
if (compareEmail) {
const signtoken = vm.signToken(checkEmail._id, 'yourSecret');
checkEmail.password = null;
return res.status(200)
.json(vm.ApiResponse(true, 200, "login sucessfull", {user: checkEmail, token: signtoken}))
}
}
} catch (e) {
return next(e);
}
};
//list manager so when staff needs to register they can select their managers
auth.route.js
'use strict';
const {Router} = require('express');
const UserController = require("./auth.controller");
module.exports = router;
So We are done with the first module which enables users to register and login into their account so in
the next module we will be working on sending a leave request as a staff and notifying the manager of
the leave request via email and also notify the staff when the manager approves or reject leave request
for the email notification we will be using SendGrid you can create an account
https://signup.sendgrid.com/
if (err) {
vm.log("error");
vm.log("err in sendgrid: ", err);
isEmailSent = false;
}
vm.log("sendgrid body:", response.statusCode);
isEmailSent = true;
});
return isEmailSent;
Create a leave folder and create three files (leave.model.js, leave.route.js, leave.controller.js)
Leave.model.js
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
}, {timestamps: true})
Leave.controller.js
const {sendMail} = require("../util/mailer");
};
};
Leave.route.js
'use strict';
const {ManagerChecker} = require("../util/RoleChecker");
module.exports = router;
And lastly, let's seed a manager account so we can test all our hard work if you've made it this far "Ooin
you're doing well"
mongoose.connect(db);
const User = require("../authentication/auth.model");
})
}
seedUser();
To use the seeder file add this to the script in your package.json file
"seed": "node util/seeder.js" then run npm run seed
if all goes well you should see this in your terminal user created then start your Nodejs server
OUTPUT:
RESULT:
Thus, the Full Stack web application develop a leave management system for an organization
where users can apply different types of leaves such as casual leave and medical leave. They also
can view the available number of days successfully completed.
Ex. No: 7
DEVELOP A SIMPLE DASHBOARD FOR PROJECT
Date: MANAGEMENT
AIM:
To Develop a simple dashboard for project management where the status of various tasks is
available. New tasks can be added and status of existing tasks can be changed among pending,
in progress and completed.
ALGORITHM:
To develop a simple dashboard for project management, you can follow these steps:
1. Design the user interface: Create a layout that displays the tasks and their statuses. You can use HTML and
CSS to create a visually appealing dashboard.
2. Create a data structure: Define a data structure to store the task information, such as an array or object.
Each task should have properties like task name and status.
3. Display tasks: Use JavaScript to dynamically display the tasks on the dashboard. You can loop through the
task data structure and generate HTML elements for each task.
4. Add task functionality: Implement a form or input field where users can add new tasks. When a task is
added, update the task data structure and refresh the dashboard to display the new task.
5. Change task status: Add buttons or dropdown menus next to each task to allow users to change the status.
When a status is changed, update the task data structure and refresh the dashboard to reflect the updated
status.
o
PROGRAM :
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
RESULT :
Thus, the development of a simple dashboard for project management where the status of various tasks
is available. New tasks can be added and status of existing tasks can be changed among pending, InProgress
and completed is successfully and implemented.
Ex. No: 8
DEVELOP AN ONLINE SURVEY APPLICATION
Date:
AIM:
To develop an online survey application where a collection of questions is available and users are
asked to answer any random 5 questions.
PROCEDURE:
Getting started with online surveys is pretty easy when you follow these 7 simple steps:
PROGRAM :
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css"> <title>Online Survey Application</title>
</head>
<body>
<header>
<h1>Online Survey Application</h1>
</header>
<main>
<div class="question-container" >
<h2>Question:</h2>
<p id="question"> </p>
</div>
<div class="answer-container">
<h2>Your Answer:</h2>
<textarea id="answer" placeholder="Enter your answer here"></textarea>
<button id="submitAnswer">Submit Answer</button>
</div>
</main>
<script src="script.js"></script>
</body>
</html> Styles.css body {
font-family: Arial, sans-serif; margin: 0;
padding: 0; } header {
background-color: #4CAF50; padding: 20px;
text-align: center; color: #fff;
}
main {
padding: 20px; display: flex;
justify-content: space-between;
}
h1, h2 { margin: 0;
}
.question-container, .answer-container { flex-basis: 45%;
}
textarea {
height: 150px; width: 100%;
margin-bottom: 10px; padding: 10px;
}
button {
padding: 10px;
background-color: #4CAF50; color: #fff;
border: none; cursor: pointer;
}
Script.js:
document.addEventListener("DOMContentLoaded", function() { const questionElement
= document.getElementById("question"); const answerElement =
document.getElementById('answer');
const submitAnswerButton = document.getElementById("submitAnswer"); const
questions=[
"What is your favorite color?", "What is your favorite food?",
"What is your favorite hobby?", "What is your favorite movie?", "What is your favorite
book?"
];
function displayRandomQuestion() {
const randomIndex = Math.floor(Math.random()*questions.length);
questionElement.textContent = questions[randomIndex];
}
RESULT:
Thus the web application develop an online survey application where a collection of questions is
available and users are asked to answer any random 5 questions created succesfullty.