# 9th Computer New Course Problem Solving Unit-01

1.1 Answer the following questions.

- In a farm there are some cows and birds. If there are total 35 heads and 110 legs, then how many cows and birds are there?

Answer:

20 Cows and

15 Birds

2. **Define problem analysis. Explain your answer along with an example.**

**Answer:** **Problem Analysis:**

Understanding a problem usually includes identification of the 5 Ws (what, who, when, where, and why). Problem analysis is the process to figure out these 5 Ws from a problem statement. Problem analysis helps to understand a given problem. These are the basic elements which lead towards the solution of a given problem.

**For example,** consider the following problem statement.

“Suppose your class teacher assigns you a task to prepare a list of students in your school whose names start with the letter ‘A’. The list is required in order to prepare an alphabetical directory of all school students, and there is only one week to complete the task.”

We can analyse this problem by identifying 5Ws in the problem statement, as given below.

- What: List of students names starting with letter ‘A’.
- Who: Students.
- Why: To prepare the directory of students.
- When: Within a week.
- Where: School.

3. **Define and algorithm and argue on its role and importance in problem-solving.**

**Answer: Algorithm:**

An algorithm is a set of steps to solve a problem. It is written in a natural language, so it is easily understandable by humans.

**Role of Algorithms in Problem Solving: **An algorithm provides a step-by-step guide to the problem solver. It is a complete description of the solution. Usually, a computer programmer first writes an algorithm and then translates it into the code of some programming language.

4. Suppose a problem has multiple algorithms. How would you choose the most efficient one? Explain with examples.

**Answer: The Best algorithm Selection**

If there are multiple algorithms for a problem then I will choose the solution which has less cost, take less time, efficient, and easy to manage.

**5. How do you determine requirements for a flowchart?**

**Answer:** **Requirements of flowchart**

In a flowchart we use input, output, decision-making and processing. These concepts are described in the following: Input means taking data from a user, processing it and give some output. For a flowchart, the requirements are to know about:

**Input:**Input means taking data from the user. It is important to know, how many and what type of inputs are required.**Processing:**A flowchart also contains processing steps. The processing steps are used for performing calculations and storing the results of calculations. These may include increasing/decreasing a value, adding/multiplying/dividing two values, etc.

**Decision-Making:**To determine whether a statement is true or false, and taking appropriate steps accordingly, is called decision-making.

**Outputs:** Outputs are used to display information, and usually this information exhibits the processed results.

6. **Explain types of test data.**

**Answer: Types of Test Data**

Creation of proper and sufficient test data is one of the key activities to improve quality of a solution. Each type of solution requires different data.

Types of Test Data include:

**Valid test data:**It is the test data that compiles with the input requirements of the algorithm. If an algorithm is supposed to take a numeric value between 1 and 100 as input, then any value between 1 and 100 is a valid test data.**Invalid test data:**It is the data that does not comply with the input requirements of the algorithm. It is necessary to make sure that the solution correctly works for invalid values, shows the relevant messages notifying the user that the provided input values are improper.**Boundary test data values:**A solution is tested on extreme values. For example, to calculate interest, we can consider principal amount as 0 or a very huge amount.**Wrong data formats:**It is wise to check how the system reacts on entering data in an inappropriate format. For example, giving an alphabet as input when a numeric value is expected.

**Absent data: **It is also important to investigate that the solution still works if less number of inputs are given than expected. For example, if a system asks to enter driving licence number, then every one cannot provide this information. It is significant to see how the system reacts in such situations.

7. Describe a trace table.

**Answer: Trace Table**

A trace table is a technique used to test algorithms, in order to make sure that no logical errors occur while the algorithm is being processed. The table usually takes the form of a multi-column, multi-row table; with each column showing names of data and each row showing values of the data at each step.

1.2 Choose the correct option.

- Which solutions are not reached through proper algorithms of work planning?

i. Prepared Solution

ii. **Candid Solution (Correct Answer)**

iii. Strategized Solution

iv. Best Solution

2. ____________________ is a graphical representation of an algorithm.

i. Matrix

ii. Graph

**iii. Flowchart (Correct Answer)**

iv. Solution

3. Which symbol in the flowchart is used to either start or end the flowcharts?

**i. Terminal (Correct Answer)**

ii. Connector

iii. Process

iv. Decision

4. ____________________ means to test if the required solution is there.

**i. Verification (Correct Answer)**

ii. Algorithm

iii. Validation

iv. Flowchart

5. In a ____________________ error, the solution is working but not giving required results.

i. Random error

**ii. Logical error (Correct Answer)**

iii. Syntax error

iv. Runtime error

1.3 Fill in the blanks.

- Before problem solving, we need to first ____________________ a problem.

Answer: analyse

2. An algorithm produces a defined set of ____________________.

Answer: steps

3. A flowchart utilizes various ____________________ and ____________________ to map out the order of steps.

Answer: symbols, text

Answer: decision making

5. ____________________ is used to test the solutions.

Answer: Verification

## Recommended Readings

### 10th Class Computer Unit-05: Functions

### 10th Class Computer New Course Data & Repetition Unit-04

### 10th Computer New Course Conditional Logic Unit-03

### 10th Class Computer New Course User Interaction Unit-02

### 10th Class Computer New Course ITP Unit-01

### 9th Computer New Course Designing Website Unit-05

### 9th Computer New Course Data and Privacy Unit-04

### 9th Computer New Course Networks Unit-03

### 9th Computer New Course Binary System Unit-02

## Buy Best Stationery Products in Pakistan

For more stationery items please visit : **https://stationerystore.pk**