i. List steps that should be followed to solve a problem.
Problem Identification, Specify Requirements, Problem Analysis, Design Algorithm/Flowchart, Coding, Testing & Debugging, Implementation, and Documentation.
ii. What is analysis? Describe its importance in solving a problem.
Analysis is the phase where a complex problem is decomposed into smaller parts. It is vital because it ensures a clear understanding of inputs, outputs, and processing requirements before coding.
iii. What method should be adopted to solve complex problems? Discuss briefly.
The Top-Down Design (Divide and Conquer) method should be adopted. It breaks down a complex problem into smaller, manageable sub-modules.
iv. What do you mean by syntax of a programming language? Is it necessary to know the syntax for solving a problem on computer?
Syntax refers to the formal rules and grammar of a programming language. Yes, knowing syntax is necessary because compilers cannot translate statement errors into machine code.
v. Differentiate runtime errors and logical errors.
Runtime errors occur during execution due to illegal operations (e.g., division by zero) and crash the program. Logical errors result from incorrect logic, producing wrong answers without crashing.
vi. Why documentation is considered vital in problem solving process?
Documentation provides essential written guides for system maintenance, future upgrades, and assisting new developers in understanding the codebase.
vii. Is it necessary for an algorithm to solve a problem in finite number of steps? If yes, why?
Yes. An algorithm must terminate after a finite number of steps to avoid infinite loops and prevent wasting computer resources.
viii. Write purpose of the different flowchart symbols.
- Oval: Start / End terminal.
- Parallelogram: Input / Output operation.
- Rectangle: Processing or calculation.
- Diamond: Decision making condition.
- Circle: Flowchart connector.
ix. Compare the flowchart and algorithm.
An algorithm is a text-based, step-by-step written plan, whereas a flowchart is a graphical/diagrammatic representation of that same logic.
x. Write an algorithm to calculate the distance covered by a car moving at an average speed v m/s in time t (s = vt).
Step 1: Start
Step 2: Input average speed (v) and time (t)
Step 3: Calculate distance s = v * t
Step 4: Display distance (s)
Step 5: End