0% found this document useful (0 votes)
228 views

Chapter 4 Notes Problem Solving

Hell yeaa

Uploaded by

zxa98023
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
228 views

Chapter 4 Notes Problem Solving

Hell yeaa

Uploaded by

zxa98023
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

I PUC CS CHAPTER 4 TRISHA VIDYA COLLEGE,KATPADY

CHAPTER 4
INTRODUCTION TO PROBLEM SOLVING
1. What is the first step in problem-solving as per the document?
A) Testing the solution B) Coding the algorithm
C) Analyzing -the problem D) Debugging the program
Answer: C) Analyzing the problem
2. What is an algorithm?
A) A set of exact steps to solve a problem B) A programming language
C) A type of computer hardware D) A method of debugging
Answer: A) A set of exact steps to solve a problem
3. Which of the following is NOT a characteristic of a good algorithm?
A) Precision B) Uniqueness C) Infinite steps D) Finiteness
Answer: C) Infinite steps
5. What does the process of 'coding' involve?
A) Writing an algorithm B) Testing the program
C) Converting the algorithm into a format understood by the computer D) Debugging the code
Answer: C) Converting the algorithm into a format understood by the computer
6. What shape is used to represent a process in a flowchart?
A) Parallelogram B) Rectangle C) Diamond D) Circle
Answer: B) Rectangle
7. In a flowchart, which symbol represents the start or end?
A) Diamond B) Rectangle C) Oval D) Parallelogram
Answer: C) Oval
8. What is the purpose of developing an algorithm before writing code?
A) To debug the program B) To convert it into machine language
C) To have a clear solution plan D) To test the program
Answer: C) To have a clear solution plan

9. Which step comes immediately after developing an algorithm?


A) Debugging B) Testing C) Coding D) Analyzing the problem
Answer: C) Coding

10. Which of the following is an essential skill for a computer science student?
A) Problem solving B) Debugging C) Coding D) All of the above
Answer: D) All of the above

12. What is the output of an algorithm?


A) Input data B) A set of instructions
C) The result of the process D) A debugging report
Answer: C) The result of the process

13. What does the parallelogram symbol in a flowchart represent?


A) Process B) Decision C) Input/Output D) Start/End
Answer: C) Input/Output
I PUC CS CHAPTER 4 TRISHA VIDYA COLLEGE,KATPADY

15. Which of the following steps is NOT part of the problem-solving process mentioned in the
document?
A) Analyzing the problem B) Developing an algorithm
C) Compiling the code D) Testing and debugging
Answer: C) Compiling the code

16. What should be done after finalizing the algorithm?


A) Debugging B) Testing C) Coding D) Analyzing the problem
Answer: C) Coding

19. Which of the following is a key component of analyzing a problem?


A) Writing the program code B) Listing the principal components of the problem
C) Testing the solution D) Debugging the program
Answer: B) Listing the principal components of the problem

20. What is the primary purpose of using an algorithm?


A) To debug the program B) To test the program
C) To increase reliability, accuracy, and efficiency D) To compile the program
Answer: C) To increase reliability, accuracy, and efficiency

21. What does the diamond shape in a flowchart represent?


A) Process B) Decision C) Input/Output D) Start/End
Answer: B) Decision

22. Which programming language can be used to write a program after developing an algorithm?
A) Only Python B) Any high-level language C) Only Java D) Only C++
Answer: B) Any high-level language

23. What must be done if the program generates incorrect output?


A) Analyze the problem B) Develop a new algorithm
C) Check for logical errors D) Ignore the output
Answer: C) Check for logical errors

25. What is the function of a 'terminator' symbol in a flowchart?


A) To represent a decision point B) To indicate the start or end of the process
C) To show data input/output D) To represent a process or action
Answer: B) To indicate the start or end of the process

26. What should be done after coding the algorithm?


A) Analyzing the problem B) Testing and debugging
C) Developing the algorithm D) Writing the problem statement
Answer: B) Testing and debugging

27. Why is precision important in an algorithm?


A) To reduce the number of steps B) To ensure the steps are clearly stated and defined
C) To make the algorithm run faster D) To avoid using high-level language
Answer: B) To ensure the steps are clearly stated and defined

28. Which step in problem-solving involves identifying the logical steps to reach a solution?
A) Analyzing the problem B) Developing the algorithm
I PUC CS CHAPTER 4 TRISHA VIDYA COLLEGE,KATPADY

C) Coding D) Testing and debugging


Answer: B) Developing the algorithm

29. Which shape in a flowchart represents input or output data?


A) Oval B) Rectangle C) Parallelogram D) Diamond
Answer: C) Parallelogram

30. Why is uniqueness important in an algorithm?


A) To ensure each step is uniquely defined B) To make the algorithm run faster
C) To reduce the number of steps D) To avoid using high-level language
Answer: A) To ensure each step is uniquely defined

31. What is the primary objective of problem-solving in computer science?


A) To debug the program B) To automate tasks efficiently
C) To reduce the size of the program D) To increase the speed of the program
Answer: B) To automate tasks efficiently

32. In a flowchart, what is used to represent a decision?


A) Oval B) Rectangle C) Diamond D) Parallelogram
Answer: C) Diamond

33. What should be the next step if an algorithm is not producing the correct output?
A) Ignoring the error B) Rewriting the problem statement
C) Revising the algorithm to check for logical errors D) Converting it into a flowchart
Answer: C) Revising the algorithm to check for logical errors

34. Why is it necessary to document the coding process?


A) To write more complex code B) To ensure the code is understandable and maintainable
C) To reduce the size of the code D) To avoid using high-level language
Answer: B) To ensure the code is understandable and maintainable

36. What is the purpose of a flowchart?


A) To represent an algorithm visually B) To write the code
C) To debug the program D) To test the solution
Answer: A) To represent an algorithm visually

37. Which of the following is NOT a step in the problem-solving process?


A) Analyzing the problem B) Writing the program
C) Testing and debugging D) Developing the algorithm
Answer: B) Writing the program

40. What does a rectangle represent in a flowchart?


A) Decision B) Input/Output C) Start/End D) Process
Answer: D) Process

42. What is the outcome of an algorithm?


A) Analyzing the problem B) Writing the program
C) Producing a result D) Debugging the program
Answer: C) Producing a result
I PUC CS CHAPTER 4 TRISHA VIDYA COLLEGE,KATPADY

43. What is the significance of 'precision' in an algorithm?


A) To reduce the number of steps B) To ensure each step is clearly defined
C) To make the algorithm faster D) To avoid using high-level language
Answer: B) To ensure each step is clearly defined

44. Why is it important to develop an algorithm before coding?


A) To reduce the size of the program B) To have a clear solution plan
C) To debug the code D) To increase the speed of the program
Answer: B) To have a clear solution plan

45. What is the role of testing in programming?


A) To analyze the problem B) To write the code
C) To identify and fix errors D) To develop the algorithm
Answer: C) To identify and fix errors

46. What shape represents the start or end in a flowchart?


A) Rectangle B) Parallelogram C) Oval D) Diamond
Answer: C) Oval

47. Which of the following best describes 'uniqueness' in an algorithm?


A) Each step is distinct and clearly defined B) The algorithm has infinite steps
C) The algorithm runs indefinitely D) The algorithm is written in a high-level language
Answer: A) Each step is distinct and clearly defined

48. What should be done if a program produces unexpected results?


A) Ignore the results B) Re-analyze the problem
C) Debug and test the program D) Write a new algorithm
Answer: C) Debug and test the program

49. What does the term 'coding' refer to in problem-solving?


A) Writing the problem statement B) Converting the algorithm into a programming language
C) Testing the program D) Analyzing the problem
Answer: B) Converting the algorithm into a programming language

### 2 Marks Questions (20 questions)


1. Define an algorithm.
Ans: An algorithm is a step by step instructions required to solve any problem. These instructions are in
user’s language that means they are independent of any programming language.

2. What is pseudocode?
Ans: It is a detailed description of instructions that a computer must follow in a particular order.

3. Explain the term "flowchart."


Ans: A flowchart is a visual representation of an algorithm. A flowchart is a diagram made up of boxes,
diamonds and other shapes, connected by arrows. Each shape represents a step of the solution process and
the arrow represents the order or link among the steps

4. What is the purpose of a flowchart?


I PUC CS CHAPTER 4 TRISHA VIDYA COLLEGE,KATPADY

Ans: A flowchart's purpose is to visually represent a process or workflow, and to help you understand
how it works

5. Write pseudocode to add two numbers.


Ans: To add two numbers
Step 1: start
Step 2: INPUT num1, num2
Step 3: COMPUTE sum= num1+num2
Step 4: OUTPUT sum
Step 5: Stop

6. What are the components of a flowchart?


Ans:
1. Terminator:
- Symbol: Oval or rounded rectangle
- Purpose: Represents the start and end points of the process.
2. Process:
- Symbol: Rectangle
- Purpose: Indicates a step or action in the process.
3. Decision:
- Symbol: Diamond
- Purpose: Represents a point where a decision must be made, leading to different paths based
on yes/no or true/false outcomes.
4. Input/Output:
- Symbol: Parallelogram
- Purpose: Represents data input or output, such as user input or system output.
5. Arrow (Flow Line):
- Symbol: Arrow
- Purpose: Indicates the direction of the flow of the process.

7. Explain the difference between pseudocode and a flowchart.


Ans: The main difference between Pseudocode and Flowchart is that pseudocode is an informal high-
level description of an algorithm while flowchart is a pictorial representation of an algorithm.

### 3 Marks Questions (20 questions)


1. Write an algorithm to find the greatest of two numbers.
Ans: Step 1 Start.
Step 2: Input the first number (num1)
Step 3: Input the second number (num2)
Step 4: If num1 is greater than num2, then set max_num to num1.
Step 5: Else, set max_num to num2.
Step 6: Display max_num as the larger number.
Step 7: Stop.
I PUC CS CHAPTER 4 TRISHA VIDYA COLLEGE,KATPADY

2. Explain the importance of pseudocode before actual coding.


Ans: Pseudocode also provides programmers with a detailed template for writing code in a specific
programming language.

3. Dscribe the process of writing a flowchart for a given algorithm.


Ans: Identify the starting point. Identify the symbols needed. Each symbol represents a specific action or
decision point in the process.

4. How can you improve an algorithm that fails for certain inputs?
Ans:
1. Read and understand the problem.
2. Analyze and optimize the problem-solving process.
3. Think and plan your solution. ...
4. Code and test your solution

5. Write pseudocode for calculating the area and perimeter of a rectangle.


Ans: Step 1: START
Step 2: INPUT Len, Width
Step 3: Compute area = len*Width
Step 4: Compute perimeter =2( len+Width)
Step 4: OUTPUT area, perimeter
Step 5: Stop

6. How do you calculate the percentage of marks in three subjects?


Ans: To calculate the percentage of marks in three subjects, you can use the following steps:
1. Add up the total marks obtained in all three subjects

2. Determine the total maximum marks possible


3. Divide the sum of marks obtained by the total maximum marks
4. Multiply the result by 100 to get the percentage

### 5 Marks Questions (15 questions)


1. Write a detailed algorithm to determine the calculate square of two numbers.
Ans: Step 1: START
Step 2: Read the value for num
Step 3: Compute square = num*num
Step 4: Display square
Step 5: Stop

2. Write a detailed algorithm to determine the calculate sum of three numbers.


Ans: Step 1: START
Step 2: Read the value for num1, num2, num3
Step 3: Compute sum = num1+num2+num3
Step 4: Display sum
Step 5: Stop
I PUC CS CHAPTER 4 TRISHA VIDYA COLLEGE,KATPADY

3. Write a detailed algorithm to determine the calculate addition, subtraction and multiplication of two
numbers.
Ans: Step 1: START
Step 2: Read the value for num1, num2
Step 3: Compute add = num+num
Step 3: Compute sub = num-num
Step 3: Compute mul = num*num
Step 4: Display Addition of two values is add
Step 4: Display Subtraction of two values is sub
Step 4: Display Multiplication of two values is mul
Step 5: Stop

4. Explain the importance of flowcharts in problem-solving with a detailed example.


Ans: It is a diagrammatic representation of the solution to a given problem but, more importantly, it
provides a breakdown of the essential steps to solving the problem.

5. Write the pseudocode and draw the flowchart for calculating the area and perimeter of a rectangle.
Ans: Step 1: START
Step 2: INPUT Len, Width
Step 3: Compute area = len*Width
Step 4: Compute perimeter =2( len+Width)
Step 4: OUTPUT area, perimeter
Step 5: Stop

6. Explain the various steps involved in problem solving.


Ans:
1. Analysing the problem : To clearly understand a problem before we begin to find the solution for it
2. Developing an Algorithm: The solution is represented in natural language and is called an algorithm
3. Coding : Convert the algorithm into the format which can be understood by the computer to
generate the desired solution. Different high level programming languages can be used for writing a
program.
4. Testing and Debugging :The program should generate correct output for all possible inputs. In case
the output generated is incorrect, then the program should be checked for logical errors, if any.

7. Explain the Characteristics of a good algorithm.


Ans: Precision — the steps are precisely stated or defined.
Uniqueness — results of each step are uniquely defined and only depend on the input and the
result of the preceding steps.
Finiteness — the algorithm always stops after a finite number of steps.
Input — the algorithm receives some input.
Output — the algorithm produces some output.

You might also like