0% found this document useful (0 votes)
2K views3 pages

Programming and Problem Solving Exam Guide

Uploaded by

sidash5156
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)
2K views3 pages

Programming and Problem Solving Exam Guide

Uploaded by

sidash5156
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

Total No. of Questions : 10] SEAT No.

:
PD-5300 [Total No. of Pages : 3

[6401]-2410
F.E. (BOS-IT)
(PCC-151-ITT): Programming and Problem Solving
(2024 Credit Pattern) (Semester - I/II)
Time : 2½ Hours] [Max. Marks : 70
Instructions to the candidate:
1) Solve Q.1 or Q.2, Q.3 or Q.4, Q.5 or Q.6,Q.7 or Q.8, Q.9 or Q.10.
2) Neat diagrams must be drawn wherever necessary.
3) Assume suitable data if necessary.

Q1) a) What are the types of problems? Explain in detail. [3]

b) Explain brief history of python programming language and list different


software developed in python. [3]

c) Describe object oriented programming features. [4]

d) Define problem solving. Write down steps of problem solving process.[4]

OR

Q2) a) Describe flowchart and symbols in detail. [3]

b) Write down the applications of python programming languages. [3]

c) Explain the python programming features. [4]

d) Describe TOP-DOWN design approach in detail. [4]

P.T.O.
Q3) a) List down all the advanced data types in python & Explain any two. [3]

b) Describe the following terms with examples (any three): [3]

i) break ii) continue iii) pass iv) range

c) Implement a program in python to check whether a number entered by


user is positive, negative, or zero [4]

d) Explain decision control statements in python in detail. [4]

OR

Q4) a) Explain different arithmetic operators with suitable example [3]

b) Write down the difference between for loop and while loop. [3]

c) Develop a python program to check whether a given number is even or


odd. [4]

d) What is the dictionary data type? Explain any 3 operations of the dictionary
data type. [4]

Q5) a) Compare Regular functions and lambda functions in python with suitable
examples. [4]

b) Describe the use of the return statement in functions with example. [5]

c) Develop an algorithm & program to concatenate two strings using +


operator. [5]

OR

Q6) a) Analyze the difference between ord ( ) and chr ( ) functions with examples.
[4]

b) Explain the concepts of variable scope (local and global) and lifetime in
python with suitable code examples. [5]

c) Implement program to reverse a string using user defined function. [5]

[6401]-2410 2
Q7) a) Describe the purpose & use of file handling. [4]

b) Differentiate between mutable and immutable data types with focus on


dictionaries in python. Provide examples. [5]

c) Implement a program to append data to an already existing file. [5]

OR

Q8) a) Explain different types of files in detail. [4]

b) Explain key directory methods: mkdir ( ), rmdir ( ) listdir ( ), and chdir ( )


with syntax and usage example. [5]

c) Develop a program to print the absolute path of a file using OS. path.
join. [5]

Q9) a) Differentiate between class variables and object variables with an example.
[4]

b) Analyze the significance of garbage collection in python how does python


handle object destruction? [5]

c) Describe classes and objects in detail. [5]

OR

Q10) a) Explain the role of __ init __( ) and __del__( ) methods in object lifecycle.
[4]

b) Distinguish between public and private members of a class with proper


examples. [5]

c) Describe data abstraction & Encapsulation in detail. [5]

  

[6401]-2410 3

Common questions

Powered by AI

Mutable data types, like dictionaries, allow modification after creation, enabling dynamic updates and flexible data structures, but can lead to inadvertent data changes. Immutable types, like tuples, are static which can enhance performance through safe multithreading and optimization by the Python interpreter. The choice between them impacts performance, safety, and concurrency handling, highlighting the importance of selecting the right type for specific program requirements .

Encapsulation hides the implementation details of a class from external users, enforcing access control through public, private, and protected access specifiers. This leads to better modularity and makes the software easier to maintain and modify. Data abstraction focuses on presenting only the necessary features while hiding the complex reality, enabling developers to focus on interactions rather than implementation. Together, they enhance system robustness by safeguarding against unintended interference and simplifying the complexity .

Flowcharts use standard symbols to represent different types of actions in a process, such as decision points, start/end points, and data input/output. They provide a visual representation of the steps in a program, aiding understanding and communication among developers. This visualization facilitates logical thinking, allowing developers to spot potential errors or inefficiencies in the program flow before actual coding begins .

Regular functions defined with the def keyword offer verbosity and readability, suitable for complex operations or those with multiple statements. Lambda functions provide a concise syntax for simple, anonymous functions, typically used for single, short operations within higher-order functions like map() or filter(). Choosing between them depends on the complexity of the task and the need for immediate function definition without a name .

Object-oriented programming (OOP) features include encapsulation, inheritance, polymorphism, and abstraction. Encapsulation binds the data and functions together, protecting it from outside interference. Inheritance allows the creation of new classes based on existing ones, promoting code reusability. Polymorphism enables objects to be treated as instances of their parent class, enhancing flexibility in code. Abstraction simplifies complex systems by modeling classes appropriate to the problem. These features contribute to effective problem solving by providing a structured approach to program design, making the code more manageable, reusable, and scalable .

Class variables are shared across all instances of a class, meaning that if one object modifies a class variable value, the change is reflected in all other instances. In contrast, object variables are instance-specific; changes to these variables only affect the particular instance. This distinction impacts program design by influencing memory usage and the behavior of objects. Proper use of class and object variables can lead to improved memory management and predictable object behavior .

The TOP-DOWN design approach involves breaking down a complex problem into smaller, more manageable components. By starting from the highest level of the problem and progressively refining it into smaller tasks, developers can focus on each part separately. This modular approach is beneficial for understanding the overall structure and enhances problem-solving by making it easier to debug, implement changes, and manage code complexity .

Python's garbage collection mechanism automatically deallocates memory for objects that are no longer referenced. It uses reference counting and a cyclic garbage collector to reclaim memory taken up by unused objects. The significance lies in the prevention of memory leaks by ensuring efficient memory use, which helps maintain application performance over time. Developers are relieved from manually managing memory, reducing the likelihood of errors .

The ord() function returns the Unicode code point for a single character string, effectively converting a character to its integer representation. Conversely, chr() does the reverse, returning a string from an integer Unicode code point. These functions are effective in scenarios where conversion between character and integer representations is needed, such as encryption, file processing, or handling character encodings .

The __init__() method initializes a new object's attributes and prepares it for use by setting up any initial state or data upon creation. The __del__() method is called when an object is about to be destroyed, providing a chance to release resources or perform clean-up tasks. Understanding the lifecycle management these methods provide is crucial for resource management and avoiding memory leaks in Python applications .

You might also like