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

AUTONOMOUS 231GES104T - PROBLEM SOLVING THROUGH PYTHON PROGRAMMING Question Bank - Unit

This document is a question bank for the course 'Problem Solving through Python Programming' at Easwari Engineering College, covering Unit 1 on algorithmic problem solving. It includes various types of questions such as definitions, algorithms, pseudocode, flowcharts, and comparisons related to programming concepts. The content is structured for first-year B.E/B.Tech students and spans topics from basic computer operations to recursion and flowcharting.

Uploaded by

Santhosh S
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)
62 views6 pages

AUTONOMOUS 231GES104T - PROBLEM SOLVING THROUGH PYTHON PROGRAMMING Question Bank - Unit

This document is a question bank for the course 'Problem Solving through Python Programming' at Easwari Engineering College, covering Unit 1 on algorithmic problem solving. It includes various types of questions such as definitions, algorithms, pseudocode, flowcharts, and comparisons related to programming concepts. The content is structured for first-year B.E/B.Tech students and spans topics from basic computer operations to recursion and flowcharting.

Uploaded by

Santhosh S
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

EASWARI ENGINEERING COLLEGE

(An Autonomous Institution)


Bharathi Salai, Ramapuram, Chennai – 6000 095

231GES104T– PROBLEM SOLVING THROUGH PYTHON PROGRAMMING

Question Bank – Unit 1

I YEAR –B.E/B.TECH
(Common to all Branches)

SEP 2024 to JAN 2024


UNIT I
ALGORITHMIC PROBLEM SOLVING
PART- A (2 Marks) CO K Level
1. What are the basic computer operations?
Basic computer operations include:
Input: Receiving data or instructions from input devices (e.g., keyboard, mouse).
Output: Sending data to output devices (e.g., monitor, printer).
Processing: Performing calculations or operations on data (e.g., executing CO1 K1
instructions).
Storage: Saving data and instructions for future use (e.g., hard drives, memory).
Control: Directing the manner and sequence in which all of the above operations
are carried out (e.g., control unit of the CPU)
2. Define algorithm and its characteristics [NOV/DEC 2022]
Algorithm: An algorithm is a finite, well-defined sequence of steps designed to
perform a specific task or solve a particular problem.
Characteristics:
Finiteness: The algorithm must have a clear end after a finite number of steps.
CO1 K2
Definiteness: Each step must be precisely defined and unambiguous.
Input: The algorithm should have zero or more inputs.
Output: The algorithm should produce at least one output.
Effectiveness: Each step should be simple enough to be carried out in a finite
amount of time
3. Write an algorithm to check whether a number is positive or negative.
Step 1: Start
Step 2: Read a number from the user.
Step 3: If number is less than zero, then print it is a negative integer. CO1 K2
Step 4: Else if number is greater than zero, then print it is a positive integer.
Step 5: Else, print the number is equal to zero.
Step 6 : Stop
4. Write the pseudocode to calculate the n number of students’ total marks and
average. [NOV/DEC 2022]

INITILIZE cs, maths, phy


COMPUTE avg := (cs + maths + phy) / 3 CO1 K2
COMPUTE percentage := ((cs + math + phy) / 300) * 100
PRINT avg
PRINT percentage
END PROGRAM
5. Write an algorithm to find minimum of 3 numbers in a list.
ALGORITHM: Find Minimum of 3 numbers in a list
Step 1: Start
Step 2: Read the three numbers A, B, C
Step 3: Compare A and B.
If A is minimum, go to step 4 else go to step 5.
CO1 K3
Step 4: Compare A and C.
If A is minimum, output “A is minimum”
else output “C is minimum”. Go to step 6.
Step 5: Compare B and C.
If B is minimum, output “B is minimum”
else output “C is minimum”.
Step 6: Stop
6. List the building blocks of an algorithm.
The building blocks of an algorithm are
⮚ Statements
⮚ Sequence CO1 K1
⮚ Selection or Conditional
⮚ Repetition or Control flow
⮚ Functions
7. Define statement. List its types.
Statements are instructions designed as components for algorithmic problem
Solving, rather than as one-to-one translations of the underlying machine language
instruction set of the computer.
CO1 K1
There are three types of high-level programming language statements Input/output
statements make up one type of statement. An input statement collects a specific
value from the user for a variable within the program. An output statement writes a
message or the value of a program variable to the user’s screen
8. Write the pseudo code to calculate the sum and product of two numbers and
display it.
INITIALIZE variables sum, product, number1, number2 of type real
PRINT “Input two numbers”
READ number1, number2
CO1 K2
COMPUTE sum = number1 + number2
PRINT “The sum is “, sum
COMPUTE product = number1 * number2
PRINT “The Product is “, product
END program
9. Draw the flowchart to accept two numbers compute sum and print the result.
[JAN 2022]

CO1 K2

10. How does flow of control work?


Control flow (or flow of control) is the order in which individual statements,
instructions or function calls of an imperative program are executed or evaluated. A CO1 K2
control flow statement is a statement in which execution results in a choice being
made as to which of two or more paths to follow
11. What is a function?
Functions are "self-contained" modules of code that accomplish a specific task.
Functions usually "take in" data, process it, and "return" a result. Once a function is CO1 K1
written, it can be used over and over and over again. Functions can be "called" from
the inside of other functions.
12. Give the rules for writing Pseudo codes. CO1 K1
⮚ Write one statement per line and Capitalize initial keywords.

⮚ Indent to show hierarchy.


⮚ Statements should be written in English and should be programming
language independent.
⮚ Steps must be understandable and concise.
⮚ Each instruction should be written in a separate list and each statement in
pseudocode should express just one action for the computer.
⮚ The keywords like READ, PRINT etc., should be written in capital letter.
13. Give the difference between flowchart and pseudo code.
Flowchart and Pseudo code are used to document and represent the algorithm. In
other words, an algorithm can be represented using a flowchart or a pseudo code. CO1 K2
Flowchart is a graphical representation of the algorithm. Pseudo code is a readable,
formally styled English like language representation of the algorithm
14. Define a flowchart.
A flowchart is a diagrammatic representation of the logic for solving a task. A
flowchart is drawn using boxes of different shapes with lines connecting them to CO1 K1
show the flow of control. The purpose of drawing a flowchart is to make the logic of
the program clearer in a visual form
15. Write down the rules for preparing a flowchart.
While drawing a flowchart, the following rules need to be followed
● A flowchart should have a start and end
● The direction of flow in a flowchart must be from top to bottom and left to
right
● The relevant symbols must be used while drawing a flowchart
● The flowchart should be clear, neat and easy to follow. CO1 K2
● Only one flow line should come out from a process symbol
● Only one flow line should enter a decision symbol. However, two or three
flow lines may leave the decision symbol
● Only one flow line is used with a terminal symbol.
● Within standard symbols, write briefly and precisely.
● Intersection of flow lines should be avoided.
16. List the categories of Programming languages.
Programming languages are divided into the following categories: Interpreted,
CO1 K1
Functional, Compiled, Procedural, Scripting, Markup, Logic-Based, Concurrent and
Object-Oriented Programming Languages
17. Compare machine language, assembly language and high-level language.
Machine language is a collection of binary digits or bits that the computer reads
and interprets. This language is not easily understandable by the human.
An assembly language directly controls the physical hardware. A program written
in assembly language consists of a series of instructions mnemonics that correspond
to a stream of executable instructions, when translated by an assembler can be
CO1 K2
loaded into memory and executed. The programs written in this language are not
portable and the debugging process is also not very easy.
A high level language is much more abstract, that must be translated or compiled in
to machine language. It is easily understandable and the programs are portable.
Debugging the code is easy and the program written is not machine dependent
18. What is the difference between algorithm and pseudo code?
An algorithm is a systematic logical approach used to solve problems in a computer
while pseudo code is the statement in plain English that may be translated later to a CO1 K2
programming language. Pseudo code is the intermediary between algorithm and
program.
19. List out the simple steps to develop an algorithm.
Algorithm development process consists of five major steps.
Step 1: Obtain a description of the problem.
Step 2: Analyze the problem. CO1 K1
Step 3: Develop a high-level algorithm.
Step 4: Refine the algorithm by adding more detail.
Step 5: Review the algorithm.
20. What are advantages and disadvantages of recursion?
Advantages Disadvantages
Recursive functions make the code look Sometimes the logic behind
clean and elegant. recursion is hard to follow
through.
CO1 K2
A complex task can be broken down into Recursive calls are expensive
simpler sub-problems using recursion. (inefficient) as they take up a lot of
memory and time.
Sequence generation is easier with recursion Recursive functions are hard to
than using some nested iteration. debug.
21. Give the differences between recursion and iteration.
Recursion Iteration
Function calls itself until the base condition is Repetition of process until the
reached. condition fails.
Only base condition (terminating condition) It involves the steps such as
is specified. initialization, condition, Increment
/decrement CO1 K2
It keeps our code short and simple. Iterative approach makes our code
longer.
It is slower than iteration due to overhead of Iteration is faster.
maintaining stack.
It takes more memory than iteration due to Iteration takes less memory.
overhead of maintaining stack.
22. Draw the Flowchart to find the largest of two numbers

CO1 K2

23. Distinguish between algorithm and program. [JAN 2022] CO1 K2


Algorithm: An algorithm is a step-by-step and logical approach that defines a
systematic process for computers to solve a specific problem.
Program: A program is a set of instructions a computer follows to perform a
specified task. Many programming languages can be used to write computer
programs. Some popular programming languages include Python, Java, C++ and C
PART- B
1. What are the building blocks of an algorithm? Explain in detail with examples.
CO1 K2
[NOV/DEC 2022 & JAN 2022]
2. Draw a flowchart to find the sum of the series 1+2+3+4+….+100 [JAN 2022] CO1 K3
3. Briefly describe iteration and recursion. Illustrate with an example: Iterative
CO1 K3
algorithm for factorial of a number
4. Explain in detail about algorithmic problem solving CO1 K2
5. Write an algorithm and draw a flowchart to calculate 24. CO1 K3
6. Evaluate the fundamental organization of computers, considering its components,
CO1 K2
architecture, and functionality
7. List down symbols for drawing flowchart and draw a flowchart to count and print
CO1 K3
from 1 to 10.
8. Write the pseudo code and draw the flowchart to find the sum of the digits of the
CO1 K3
number.
9. Write an algorithm and draw the flowchart to find the net salary of an employee CO1 K3
10. Write an algorithm and the pseudo code to guess an integer number in the given
CO1 K3
range.
11. Write algorithm, pseudo code and flowchart to find minimum in a list of numbers.
CO1 K3
[JAN 2022]
12. Write an algorithm and draw the flow chart to check the given number is Armstrong
CO1 K3
number or not.
Part - C
13. Write the pseudo code and draw the flowchart to print n Fibonacci numbers using
CO1 K5
recursive functions.
14. Write the algorithm and draw the flowchart using functions to find nCr value for the
CO1 K5
given n and r values.
15. Develop the algorithm and flowchart to calculate electricity bill for the given
number of units consumed.
Units Consumed Rate
1-100 NIL CO1 K5
101-200 Rs.2
201-500 Rs.3
>500 Rs.4

You might also like