Engineering Python : UNIT I : Computational Thinking and Problem Solving : Anna University Two Marks Questions & Answers
Two Marks Questions with Answers
Q.
1 What is algorithm ? AU :
Jan.-18
Ans. : An
algorithm is a finite set of instructions for performing a particular task. The
instructions are nothing but the statements in simple English language.
Q.
2 Enlist the basic building blocks of algorithms.
Ans. : The basic building blocks of algorithms
are - Assignment statements, control statements and functions.
Q.
3 What is pseudo code ?
Ans. : Pseudocode is an artificial and
informal language that helps programmers develop algorithms. Pseudocode is a
"text-based" detail (algorithmic) design tool.
Q.
4 Define the flow chart.
Ans. : Flow chart is a graphical
representation of the algorithm. Using specific notations the algorithm is
represented using the flow chart.
Q.
5 What is programming language ? Give examples.
Ans. : Programming languages are formal languages
that have been designed to implement algorithm.
Example
- C, C++, Java, Python are some programming languages that are used commonly.
Q.
6 Enlist different steps used in algorithmic problem solving.
Ans. : Various steps used in algorithmic
problem solving are,
1.
Identify the problem
2.
Understand the problem
3.
Identify the alternative ways to solve problem
4.
Select the best way to solve the problem from the list of alternative solution.
5.
List the instructions using selected solution
6.
Evaluate the solution.
Q.
7 What is recursion ?
Ans. : Recursion is a method of solving
problems that involves breaking a problem down into smaller and smaller
subproblems until you get to a small enough problem that it can be solved
trivially.
Q.
8 Enlist the properties of recursion.
Ans. : There are three important laws of
recursion :
1.
A recursive algorithm must have a base case.
2.
A recursive algorithm must change its state and move toward the base case.
3.
A recursive algorithm must call itself, recursively.
Q.
9 List the symbols used in drawing the flowchart.
AU
: May-19
Ans.
Symbols used in Flowchart
Flow lines are used to indicate the flow of data. The arrow heads are important for flowlines. The flowlines are also used to connect the different blocks in the flowchart.
These are termination symbols. The start of the flowchart is represented by the name of the module in the ellipse and the end of the flowchart is represented by the keywords End or Stop or Exit
The rectangle indicates the processing. It includes calculations, opening and closing files and so on.
The parallelogram indicates input and output.
The diamond indicates the decision. It has one entrance and two exits. One exit indicates the true and other indicates the false,
The process module has only one entrance and one exit.
This polygon indicates the loop A indicates the starting of the counter S indicates the step by which the counter is incremented or decremented B indicates the ending value of the counter Using the counter the number of times the looping instruction gets executed.
The on-page connector connects the two different sections on the same page. A letter is written inside the circle. The off-page connector connects the two different sections on the different pages. The page numbers are used in off-page connector. These two symbols should be used as little as possible because then the readability of the flowchart may get affected.
Q.
10 Distinguish between algorithms and programs.
AU
: Dec.-19
Ans. : Algorithm : The algorithm is a
solution to a given problem in the form of simple and logical steps. The
algorithm can be expressed using flowchart or a natural language.
Program
:
Program refers to the code which follows the basic rules of the concerned
programming language.
Program
is expressed in a programming language code which is compiled and executed on
computer.
Problem Solving and Python Programming: UNIT I: Computational Thinking and Problem Solving : Tag: Engineering Python : Computational Thinking and Problem Solving | Problem Solving and Python Programming - Anna University Two Marks Questions & Answers
Problem Solving and Python Programming
GE3151 1st Semester | 2021 Regulation | 1st Semester Common to all Dept 2021 Regulation