assignment by faisal
assignment by faisal
Department : (S.E.T)
Course : Programming Fundamentals
ASSIGNMENT: 01
Task 1:
Q: 01 Define the term "programming" and explain its importance in today's world.?
Programming is the process of creating a set of instructions that a computer can follow to perform
specific tasks or solve problems. It involves designing, writing, testing, debugging, and maintaining code.
In the modern digital age, programming is essential. It powers technology across industries, drives
innovation, and enables the automation of tasks, data analysis, and the development of cutting-edge
solutions like artificial intelligence and blockchain.
Programming languages are tools that developers use to communicate with computers. They provide
syntax and structure for coding, enabling the creation of everything from simple scripts to complex
applications. Different languages serve specific purposes—for example, Python excels in data analysis,
JavaScript is vital for web development, and C++ is known for high-performance computing.
Task 2
Task 3
Algorithm An algorithm is a step-by-step procedure or set of rules for solving a problem or performing a
task systematically.
Pseudo Code Pseudo code is a simplified and informal way of describing an algorithm. It uses a mix of
natural language and programming-like syntax, making it easy to understand and convert into actual
code.
• Pseudo code translates the algorithm into a human-readable format that bridges the gap between
logic and actual programming.
Q: 03 Write a simple algorithm for finding the sum of two numbers”
Algorithm:
1. Start.
2. Input the first number (num1).
3. Input the second number (num2).
4. Add num1 and num2 to find the sum.
5. Display the sum.
6. Stop.
Pseudo Code:
BEGIN
INPUT num1
INPUT num2 sum ←
num1 + num2
OUTPUT sum
END
Task 4
Advantages of Algorithms
Q: 01 Discuss the importance of algorithms in computer programming?
Algorithms are the backbone of programming. They ensure that problems are solved systematically and
efficiently, leading to reliable and optimized solutions.
Advantages of Algorithms:
1. Improving Efficiency Algorithms optimize resources like time and memory, making programs
faster and more resource-efficient.
a. Example: Sorting algorithms like Quicksort organize data efficiently.
2. Scalability Well-designed algorithms can handle large datasets and scale as the problem size
increases.
a. Example: Search engines process massive amounts of data using algorithms to deliver
accurate results.
3. Reusability Algorithms act as blueprints that can be reused across different applications and
scenarios, saving development time.
a. Example: Encryption algorithms are applied in securing communication and data
storage.