0% found this document useful (0 votes)
7 views11 pages

Presentation Oops

The document presents a web-based voting system project developed by Hamza Raheem Malik, utilizing JavaScript for the frontend and Python with OOP principles for the backend. It outlines the system architecture, user roles, data flow, and OOP concepts applied, such as encapsulation and abstraction. Future enhancements include a user login system, graphical result charts, and an admin dashboard.

Uploaded by

achamurtaza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views11 pages

Presentation Oops

The document presents a web-based voting system project developed by Hamza Raheem Malik, utilizing JavaScript for the frontend and Python with OOP principles for the backend. It outlines the system architecture, user roles, data flow, and OOP concepts applied, such as encapsulation and abstraction. Future enhancements include a user login system, graphical result charts, and an admin dashboard.

Uploaded by

achamurtaza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Presentation For OOPS

Name :- Hamza Raheem Malik


Roll no:- F24-598
Professor :- Jamal Abdul Ahad
Project Oveview
 A web-based system that lets users vote on a
given question.
Admins can create, delete, and manage polls.
Built with:
 JavaScript for interactive frontend
 Python (OOP) for backend logic
System Architecture
Frontend: HTML, CSS, JS
Backend: Python (Flask recommended)
Database (optional): MySQL
Users Roles
Admin
 Create, delete polls
 View results
User
 View poll
 Vote once per poll
Frontend Voting Page(JavaScript)
<!DOCTYPE html>
<html>
<head>
<title>Online Poll</title>
<style> body {
font-family: Arial
, sans-serif;
text-align: center;
padding: 50px; }
.poll {
background-color: #f4f4f4;
padding: 20px; border-radius: 10px;
display: inline-block; }
button {
margin-top: 10px; }
</style>
</head>
<body>
<div class="poll">
<h2>Which is your favorite programming language?</h2>
<form id="pollForm">
<input type="radio" name="vote" value="Python"> Python<br>
<input type="radio" name="vote" value="JavaScript"> JavaScript<br>
<input type="radio" name="vote" value="Java"> Java<br>
<input type="radio" name="vote" value="C++"> C++<br><br> <button type="button" onclick="submitPoll()">Submit Vote</button>
</form>
<p id="result"></p>
</div>
<script>
function submitPoll() {
let choices = document.getElementsByName('vote');
let selected = null;
for (let i = 0; i < choices.length; i++) {
if (choices[i].checked) { selected = choices[i].value;
break; } }
if (selected) { document.getElementById("result").innerHTML =
"Thanks for voting! You selected: <strong>" + selected + "</strong>";
} else {
document.getElementById("result").innerHTML = "Please select an option!"; } }
</script>
</body>
</html>
OOPS Design in Python Backend
class Poll:
def _init_(self, question,
options):
self.question = question
self.options = options
self.votes = [0] * len(options)
def vote(self, option_index):
self.votes[option_index] += 1
class User:
def _init_(self, username):
self.username = username
self.voted_polls = set()
Data Flow
1. Admin creates poll → Saved in Python
backend
2. User opens poll (JS fetches data)
3. User selects option and votes
4. Vote sent to Python backend (via Flask)
5. Backend updates data and sends
confirmation
OOPS Consept Used
Class & Object: Defined entities like Poll,
User
Encapsulation: Private poll data, controlled
access
Inheritance (Optional): Admin can inherit
User
Polymorphism: Same method name in
different contexts
Abstraction: Backend hides internal logic
from frontend
Sample Poll Display
Question: Which framework do you prefer?
Options:
• React
• Vue
• Angular
(Poll rendered using JavaScript, votes handled
by Python)
Future Enhancements
User login system
Expiry timer for polls
Graphical result charts (JS charts)
Admin dashboard
IP-based or session-based vote prevention
OOP makes backend
scalable and
organized.JavaScript
enables interactive
user experience.A
complete full-stack
mini project ideal for
learning OOP in real
applications.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy