Download as pdf or txt
Download as pdf or txt
You are on page 1of 151

TE

ST
ED
IT
IO
N
THE TEXTBOOK OF

COMPUTER
SCIENCE

For Grade
10

SINDH TEXTBOOK BOARD, JAMSHORO


N
IO
IT
ED
ST
TE

THE TEXTBOOK OF

COMPUTER
SCIENCE

For Grade

10
SINDH TEXTBOOK BOARD, JAMSHORO
All rights are reserved with the SINDH TEXTBOOK, BOARD, JAMSHORO.
Prepared by ASSOCIATION FOR ACADEMIC QUALITY (AFAQ) for SINDH TEXT BOOK
BOARD JAMSHORO.
Reviewed by Provincial Review Committee Directorate of Curriculum Assessment and
Research Sindh Jamshoro (DCAR).
Prescribed as a Textbook by the Boards of Intermediate and secondary Education, Karachi,
Hyderbad, Sukkur, Larkana Mirpurkhas and Shaheed Benazirabad for Secondary School
Certificate Examination in the Province of Sindh.
Approved by the Education and Literacy Department, Government of Sindh.
No. SO(C)SELD/STBB-18/2021 Dated: 14th July, 2021 for the province of Sindh.

Patron in Chief
Pervaiz Ahmed Baloch
Chairman, Sindh Textbook Board.

Shahid Warsi Khawaja Asif Mushtaq


Managing Director Project Director
Association For Academic Quality (AFAQ) Association For Academic Quality (AFAQ)

Rafi Mustafa Yousuf Ahmed Shaikh


Project Manager Cheif Supervisor
Association For Academic Quality (AFAQ) Sindh Textbook Board.

Supervisor
Daryush Kafi
Sindh Textbook Board, Jamshoro
AUTHORS REVIEWERS

MS. Zufishan Kamal Mr. Abdul Majeed Bhurt


Mr. Ajmal Saeed Professor (Retd.) Muhammad Zahid Shaikh
Mr. Hanif Ahsan Zubedi Mr. Imran Pathan
Mr. Amjad Ali Yousuf Zai
Mr. Mushtaque Ahmed Ansari
Editor
Khawaja Asif Mushtaq TECHNICAL ASSISTANCE CO-
ORDINATOR
DESIGNING & ILLUSTRATION
Mr. M. Arslan Shafaat Gaddi
M. Arslan Chauhan

Printed at:
PREFACE
After textbook of Computer Science for Grade 9, Computer Science for
Grade 10 is now ready to be used by teachers and students. This textbook has been
developed on Curriculum of Computer Science 2018 reviewed by Directorate of
Curriculum, Assessment and Research Sindh, Jamshoro.

We expect that this book will fulfill the diverse needs of students studying
public and private schools across Sindh. This textbook encompasses some very
important of skill required in 21st century like Algorithm Designing, Problem
Solving, Logic Design and above all Coding. To compete with the rapidly
changing world we need to equip our youth with these skills.

IT is an area from where we have great potential. With skillful youth we


can generate a lot of foreign exchange even if we have very limited resources.
Teachers can play and an important role to equip students with IT skills and this
textbook will be helpful for them.

We believe that this book will help student to imagine and perceive beyond
this textbook, and instead of cramming the knowledge given in the book, they will
make efforts to develop and strengthen their own ideas and skills.

Our organization is indebted to Association For Academic Quality


(AFAQ), all the Authors and Reviewers of this book who made rigorous efforts to
deliver a book that is competitive with any other textbook at this level. We
encourage teachers, students, parents, researchers and all the stakeholders to give
their feedback and suggestion to further improve this book.

Chairman
Sindh Textbook Board, Jamshoro
CONTENTS

Unit Page
No.
Description
No.

PROBLEM SOLVING AND ALGORTHM


1. 1
DESIGNING

2. BASICS OF PROGRAMMING IN C++ 20

3. INPUT/OUTPUT HANDLING in C++ 48

4. CONTROL STRUCTURE 70

5. FUNCTIONS 93

6. DIGITAL LOGIC AND DESIGN 107

7. INTRODUCTION TO SCRATCH 123


PROBLEM Unit
1
SOLVING AND
ALGORITHM
DESIGNING
2
3

Dene the Generate


problem alternatives

Implement Choose a
the solution solution
4
5
6
7
8
9

Start Stop
10
11

Start

Input x,y,z

Sum = x+y+z

Percent = Sum/300 * 100

If percent > 70 No

Yes

Print “Well Print “Well


done” done”

Stop
12
13

Push Pop

Back Front
Dequeue
Enqueue
14

Memory Location
200 201 202 203 204 205 206
U B F D A E C
0 1 2 3 4 5 6
Index
15

1
2 3

4 5 6 7

8 9 10 11 12 13

1 2

5 4

6
16
17
18
19
20

BASICS OF
Unit
2
PROGRAMMING
OF C++
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

INPUT/OUTPUT
Unit
3
HANDLING IN
C++
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

Unit
4
CONTROL
STRUCTURE
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

FUNCTIONS
Unit
5
94
95
96
97
98
99
100
100
101
101
102
103
103
104
104
105
105
106
106
107

DIGITAL LOGIC
Unit
6
AND DESIGN
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123

Unit
7
INTRODUCTION
TO SCRATCH
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146

You might also like