# 9th Computer New Course Problem Solving Unit-01

1. 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? 20 Cows and

15 Birds

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.

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.

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?

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.

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.

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.

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

i. Prepared Solution

iii. Strategized Solution

iv. Best Solution

2. ____________________ is a graphical representation of an algorithm.

i. Matrix

ii. Graph

iv. Solution

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

ii. Connector

iii. Process

iv. Decision

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

ii. Algorithm

iii. Validation

iv. Flowchart

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

i. Random error

iii. Syntax error

iv. Runtime error

1.3 Fill in the blanks.

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

2. An algorithm produces a defined set of ____________________.

3. A flowchart utilizes various ____________________ and ____________________ to map out the order of steps. 5. ____________________ is used to test the solutions.

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

In this unit PTB 10th Class Conditional Logic Unit-03, we will learn conditional statements, selection statements and solve programming exercises and objective.

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

10th Class Computer New Course User Interaction Unit-02 Q.1 Multiple choice questions. printf is used to print ____________________ type of data. a) int b) float c) char d) All of them (Correct Answer) 2. scanf is a ____________________ in C programming language. a) keyword b) library c) function (Correct Answer) d) none of them 3. […]

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

In this unit, we will learn programming environment, tools for writing programs, who and how to write the computer program and how we get the require result.

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

In this unit, we will learn HTML basics, text formatting, creating lists, images, background, hyperlinks, and creating tables. Then we will solve the exercise.

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

"Secure data transfer". Data is converted to unreadable format before sending and then converted to readable format after reaching it's destination.

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

9th Computer New Course Networks Unit-03 3.1 Choose the correct option. The IPv4 address is made up of ____________________ binary bits. i. 31 ii. 29 iii. 32 (Correct Answer) iv. 30 2. Routing is the process of taking data from one device and sending it to another device in different ____________________. i. Channel ii. Network […]

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

A computer understands the language of 1s and 0s only, called machine language. The number system that only contains 1s and 0s is called binary number system.

## Piano Ballpoint Pen ## ORO Trimetal Pencil ## Dollar Clipper Pen ## UHU 10×7 ml Pack of 10 PCs ## Glue Stick 8g Pack Of 12 PCs ## Color Pencils Box of 12 PCs For more stationery items please visit     :     https://stationerystore.pk