0% found this document useful (0 votes)
2 views6 pages

Assignment 1 PPL

The document outlines an assignment involving the creation of an interactive timeline of programming languages, evaluation of IDEs, and implementation of a simple banking system using both procedural and object-oriented paradigms. It includes recommendations for IDEs based on specific tasks and a comparison of code structures and features between the two programming paradigms. The assignment emphasizes the differences in design, code handling, and scalability between procedural and object-oriented programming.

Uploaded by

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

Assignment 1 PPL

The document outlines an assignment involving the creation of an interactive timeline of programming languages, evaluation of IDEs, and implementation of a simple banking system using both procedural and object-oriented paradigms. It includes recommendations for IDEs based on specific tasks and a comparison of code structures and features between the two programming paradigms. The assignment emphasizes the differences in design, code handling, and scalability between procedural and object-oriented programming.

Uploaded by

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

Assignment 1

Sujal Pawar[SCOC50] S8 1
| Page
1. Research and create an interactive timeline of programming
languages.
Select 5–10 programming languages from different paradigms (e.g., C,
Python, Prolog, Haskell).
Include: Year of creation.
Paradigm(s) supported.
Key features and real-world applications.
Tools: Use tools like Canva, Visme, or Google Slides to create the
timeline.

Ans:

Link of PPT for Timeline of programming languages


https://www.canva.com/design/DAGeoWCiemE/RkBI2_k0CBcLeshTggRG
vw/edit?utm_content=DAGeoWCiemE&utm_campaign=designshare&utm_
medium=link2&utm_source=sharebutton

Evaluate real-world programming environments.


Choose 2–3 IDEs (e.g., Visual Studio Code, Eclipse, PyCharm).
Compare their features (e.g., debugging, syntax highlighting,
extensions). Provide a recommendation for specific tasks or
programming languages. Prepare comparison table.
Ans:

Sujal Pawar[SCOC50] S8 2
| Page
Recommendation
• Use VS Code for web development, JavaScript, and lightweight
2. coding.
• Use PyCharm for Python, AI/ML, and Django development.
• Use Eclipse for Java and enterprise applications.

Sujal Pawar[SCOC50] S8 3
| Page
Apply multiple programming paradigms to solve the same
problem.
Build a simple banking system with the following features:
Deposit and withdrawal.
Balance check.
Implement it in:
Procedural paradigm (e.g., C or Python).
Object-Oriented paradigm (e.g., Java or Python with OOP).
Compare the design and code of each. Prepare comparison table.

Ans:

To demonstrate how the procedural paradigm and the object-oriented


paradigm handle the same problem differently, we will build a simple
banking system with the following features:
1. Deposit money
2. Withdraw money
3. Check balance
This will be implemented in:
• Procedural Python (representing the procedural paradigm)
• Object-Oriented Python (representing the object-oriented
paradigm)

1. Procedural Paradigm (Python)


In the procedural paradigm, the focus is on writing functions to handle
operations, and data is typically passed between them as arguments.

Code:

# Procedural Banking System


balance = 0

def deposit(amount):
global balance
if amount > 0:
balance += amount
print(f"Deposited: ${amount}")
else:

Sujal Pawar[SCOC50] S8 4
| Page
print("Invalid deposit amount.")

def withdraw(amount):
global balance
3. if 0 < amount <= balance:
balance -= amount
print(f"Withdrawn: ${amount}")
else:
print("Invalid withdrawal amount or insufficient funds.")

def check_balance():
print(f"Current Balance: ${balance}")

# Example usage
deposit(100)
withdraw(40)
check_balance()

2. Object-Oriented Paradigm (Python)


In the object-oriented paradigm, the focus is on defining classes that
encapsulate both data (attributes) and methods (functions) that
operate on that data.

Code:

# Object-Oriented Banking System


class BankAccount:
def __init__(self, balance=0):
self.balance = balance

def deposit(self, amount):


if amount > 0:
self.balance += amount
print(f"Deposited: ${amount}")
else:
print("Invalid deposit amount.")

def withdraw(self, amount):

Sujal Pawar[SCOC50] S8 5
| Page
if 0 < amount <= self.balance:
self.balance -= amount
print(f"Withdrawn: ${amount}")
else:
print("Invalid withdrawal amount or insufficient funds.")

def check_balance(self):
print(f"Current Balance: ${self.balance}")

# Example usage
account = BankAccount()
account.deposit(100)
account.withdraw(40)
account.check_balance()

Feature Procedural (Python) Object-Oriented (Java)


Paradigm Procedural Programming Object-Oriented Programming
Code Structure Functions & Global Variables Classes & Objects
Separate functions modify
Data Handling Encapsulated within objects
global variables
Lower, functions need High, methods can be reused via
Reusability
modification for reuse objects
More scalable, supports inheritance
Scalability Less scalable
& polymorphism
No data hiding, uses global Encapsulated data with
Encapsulation
variables getter/setter methods
Everything within class, promoting
Modularity Functions grouped separately
modularity

Sujal Pawar[SCOC50] S8 6
| Page

You might also like