Two Marks
Two Marks
Algorithms, building blocks of algorithms (statements, state, control flow, functions), notation
(pseudo code, flow chart, programming language), algorithmic problem solving, simple
strategies for developing algorithms (iteration, recursion). Illustrative problems: find minimum in
a list, insert a card in a list of sorted cards, guess an integer number in a range, Towers of Hanoi.
TWO MARKS
1. What is an algorithm?
1. An algorithm is a step by step procedure for solving a particular problem
2. The algorithm is used to refer the logic of the program.
3. It is one of the basic tools used to develop the problem solving.
1
5. Write some rules for drawing flowchart.
The standard symbols must be used.
The arrowheads in the flowchart represent the direction of flow of control in the
problem.
The usual direction of the flow of a procedure is from top to bottom or left to right.
The flow lines should not cross each other.
Be consistent in using the names and variables in the flowchart.
Keep the flowchart as simple as possible.
2
9. What is the use of decision box in flowcharts?
The decision symbol is used in a flowchart to indicate the point where a decision is to be
made and branching done based on the result of the decision to one or more alternative
paths. The criteria for decision making is written in the decision box.
12. Develop an algorithm to get marks for 3 subjects and declare the result. If the
marks > 35 in all the subjects the student passes else fails.
Algorithm:
Step 1 - Start.
Step 2 - Declare three variables m1, m2, and m3.
Step 3 - Read marks of three subjects ml, m2, and m3.
Step 4 - If ml >= 35 goto step 5 else goto step 7
Step 5 - If m2 >= 35 goto step 6 else goto step 7
Step 6 - If m3 >= 35 print Pass then goto step 8
Step7 - Print fail
Step 8 - Stop
3
14. Draw the flowchart for following: read age of a person. If age less than 60 then
print "Not a senior citizen" otherwise print "Senior Citizen".
Start
Read Age
Yes
Print Not a Senior citizen
Stop
4
19. List out some Programming languages.