You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 13, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+158Lines changed: 158 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
Congratulations on making such a great decision to learn programming. In this repository we will focus on the concepts of programming more than solving problems.
4
4
## Table of Contents
5
5
*[<i>Preface</i>](#preface)
6
+
*[<b>Chapter 0 - An Overview of PC Components</b>](#chapter-0)
6
7
*[<b>Chapter 01 - Programs and Programming</b>](#chapter-01)
@@ -15,3 +16,160 @@ Congratulations on making such a great decision to learn programming. In this re
15
16
*[<b>Chapter 10 - Algorithms and Flowcharts</b>](#chapter-10)
16
17
*[<b>Chapter 11 : Pseudo Codes</b>](#chapter-11)
17
18
19
+
# Preface
20
+
21
+
# Chapter-0
22
+
## An Overview of PC Components
23
+
24
+
### Input / Output Devices
25
+
* Input Devices
26
+
_Accepts information from the user and transforms it into digital code that the computer can process
27
+
_Example: keyboard, mouse, scanner
28
+
* Output Devices
29
+
_An interface through which the computer conveys its output to the user
30
+
_Example: monitor, printer
31
+
32
+
### Main Memory
33
+
• A semiconductor device which stores the
34
+
information necessary for a program to run.
35
+
• 2 types
36
+
• ROM (Read Only Memory)
37
+
• Contains information that is necessary for the
38
+
computer to boot up
39
+
• The information stays there permanently even
40
+
when the computer is turned off.
41
+
• RAM (Random Access Memory)
42
+
• Contains instructions or data needed for a
43
+
program to run
44
+
• Gets erased when the computer is turned off.
45
+
46
+
### Central Processing Unit (CPU)
47
+
• Does most of the work in executing a program
48
+
• The CPU inside a PC is usually the
49
+
microprocessor
50
+
• 3 main parts:
51
+
• Control Unit
52
+
• Fetch instructions from main memory and puts
53
+
them in the instruction register
54
+
• ALU (Arithmetic Logic Unit)
55
+
• Executes arithmetic operations
56
+
• Registers
57
+
• Temporarily stores instructions or data fetched
58
+
from memory
59
+
60
+
#### Storage Devices
61
+
• A magnetic, optical, magneto-optical or flash
62
+
device used to store a large amounts of
63
+
information.
64
+
• Stores the software components or data
65
+
needed for the computer to execute its tasks.
66
+
• Can be “read only” or “writable”.
67
+
• Example: Hard drive, DVD-ROM, DVD-RW,
68
+
USB flash drive
69
+
70
+
### Network Devices
71
+
• Connects a computer to other computers.
72
+
• Enables users to access data or execute
73
+
programs remotely.
74
+
• Example: modem, router, switch, Ethernet
75
+
card
76
+
77
+
# Chapter 02
78
+
79
+
Programs: A Program is a set of logically related instructions that is arranged in a sequence that directs the computer in solving a problem. Computer programs are one component of software, which also includes documentation and other intangible components. A computer program in its human-readable form is called source code.
80
+
Programming: The process of writing a program is called programming. Computer programming is the process of performing a particular computation, usually by designing and building an executable computer program. Programming involves tasks such as analysis, generating algorithms, profiling algorithms' accuracy and resource consumption, and the implementation of algorithms.
81
+
Computer Software: It can be broadly classified into two categories:
82
+
1. System Software: An operating system that manages the computer’s resources effectively, takes care of scheduling multiple jobs for execution, and manages the flow of data and instructions between the input/output units and the main memory. (ex: windows 7, windows 10, Linux, Mac. etc.)
83
+
a. Language Translator
84
+
b. Operating System
85
+
c. Utilities
86
+
d. Special Purpose Program
87
+
88
+
2. Application Software: Application software is written to enable the computer to solve a specific data processing task. (ex: Database management software, Spreadsheet software, multimedia software. Etc.)
89
+
a. Pre-written software
90
+
b. User-written application programs.
91
+
Classification of Programming Languages: Programming languages are basically classified into two main categories – Low- level language and High-level language. Every programming language belongs to one of these categories and sub-category.
2. Middle-level language: to write applications and system programs. Ex: C.
94
+
3. Low-level language: mostly used to write system programs. Ex: Assembly language.
95
+
96
+
Machine Language (also referred as machine code): This is a sequence of instructions written in the form of binary numbers consisting of 1’s or 0’s to which the computer responds directly.
97
+
a. Advantage of machine language: As computers only understands 0/1, binary numbers, when we write any language. e.g., C. we need a translator program to translate it into computer understandable binary numbers. Machine language itself understands 0/1 directly. Therefore, the computer directly starts executing the machine language instructions, and it takes less execution time.
98
+
b. Disadvantage of machine language: It is difficult to understand and develop a program using machine language. It is Machine dependent and Difficult to debug and modify.
99
+
Examples: 0011 1100 Load A register with value 7
100
+
0000 0111
101
+
Assembly Language: When symbols such as letters, digits, or, special characters are employed for the operation, operand and other parts of the instruction code, the representation is called an assembly language. Such representations are known as mnemonic codes; they’re used instead of binary codes. A program written with mnemonic codes forms an assembly language program.
102
+
a. Advantages: Writing a program in assemble language is more convenient and readable than writing one in machine language. Instead of binary sequence, as in machine language, a program in assembly language is written in the form of symbolic instructions.
103
+
b. Disadvantages: It is machine dependent and designed for a specific make and model of a microprocessor that’s why assembly language programs written for one processor won’t work on a different processor. So, it’s not portable and difficult.
104
+
Example: LD A, 7 Load register A with 7
105
+
High-level Languages: These languages have instructions that are similar to human languages and have a set of grammar that makes it easy for a programmer to write programs and identify and correct errors in them. To illustrate this point, a program written in BASIC, to obtain the sum of two numbers, is shown below.
106
+
Stmt. No. Program statement Comments
107
+
10 LET X=7 Put into X
108
+
20 LET Y=10 Put 10 into Y
109
+
30 LET SUM = X+Y Add values in X and Y and put in SUM
110
+
40 PRINT SUM Output the Content in SUM
111
+
High-level languages are classified as procedural and non-procedural and problem-oriented languages. High-level languages are easy to prepare and debug and they’re not machine oriented when Low-level languages are machine oriented.
112
+
1. Procedural Languages: - a. Algorithmic Languages: C, COBOL and FORTRAN.
113
+
b. Object-oriented Languages: C++, Java
114
+
2. Non-procedural Languages: -
115
+
3. Problem-oriented Languages: - These are designed for developing a convenient expression of a given class of problems.
116
+
The Process of Programming:
117
+
1. Understand the problem to the solved.
118
+
2. Think and design the solution logic.
119
+
3. Write the program in the chosen programming languages.
120
+
4. Translate the program to machine code.
121
+
5. Test the program with simple data.
122
+
6. Put the program into operation.
123
+
Translators: Suppose two people are trying to communicate with each other. One knows Hindi and another one knows English. So how they will communicate. They can communicate if they have a translator who can convert Hindi to English and English to Hindi. A translator or programming language processor that converts a computer program from language to another. It takes a program written in source code to converts into machine code There are 3 types of translators-
124
+
1. Assembler: The assembler is used to translate the program written in assembly language into machine level language. The source program written in the assembly language is given as the input to the assembler. The output generated by assembler is the object code or machine code understandable by the computer.
125
+
FAP – Fortran Assembly Program
126
+
MAP – Macro Assembly Program
127
+
2. Compiler: The compiler will read the complete source program written in high level language, if the code is error free then it will convert into machine level language. The compiler specifies the errors at the end of compilation, if there are any errors in the source code. The errors must be removed before the compiler can successfully recompile the source code again.
128
+
COBOL – Common Business Oriented Language
129
+
3. Interpreter: Just like compiler, interpreter is used to convert high-level language to machine level language. It converts one at a time and reports errors detect once, while doing conversion. With this it is easier to detect errors than in a compiler. An interpreter is faster than a compiler as it immediately executes the code upon reading the code.
130
+
Python
131
+
Structured Programming Concept: A better way of programming – a systematic way to organize programs called structured programming.
132
+
Algorithms: According to the computer scientist Niklaus Wirth stated that- PROGRAM = ALGORITHMS + DATA
133
+
An algorithm is a part of the plan for the computer program and an effective procedure for solving a problem in a finite number of steps. Algorithm may be represented in various ways. These are four ways of stating algorithms-
134
+
• Step-form: The procedure of solving a problem is stated with written statements. Each statement solves a part of the problem and these together complete the solution. The step-form uses normal language to define each procedure.
135
+
• Pseudo-code: The pseudo-code is a written form representation of the algorithm but it differs from the step-form as it uses a restricted vocabulary to define its action of solving the problem.
136
+
• Flowchart & Nassi-Schneiderman: These two are graphically oriented representation forms. They use symbols and language to represent sequence, decision and repetition actions.
137
+
Algorithms show these three features:
138
+
1. Sequence (also known as process): Sequence means that each step or process in the algorithm is executed in the specific order.
139
+
2. Decision (also known as selection): (if…. then, if…. then…. else…) In algorithms the outcome of a decision is either true or false; there is no state in between.
140
+
If proposition
141
+
then process1
142
+
else process2
143
+
This is the if… then… else… form of the decision. This means that if the preposition is true then execute process1, else, or otherwise, execute process2.
144
+
3. Repetition (also known as iteration or looping): repeat and while. repeat loop, while loop, if… then go to ... loop. The repeat loop is used to iterate or repeat a process or sequence of processes until some condition becomes true. It has the general form:
145
+
Syntax: Example:
146
+
Repeat Repeat
147
+
Process1 Fill water in kettle
148
+
Process2 until kettle is full
149
+
……….……
150
+
ProcessN
151
+
Until proposition
152
+
153
+
While preposition while kettle is not full
154
+
Begin fill water in kettle
155
+
Process1
156
+
Process2
157
+
……………
158
+
ProcessN
159
+
end
160
+
161
+
If … then goto … is:
162
+
Process1 Fill some water in kettle
163
+
Process2 if kettle not full then goto 1
164
+
……………
165
+
ProcessN
166
+
If proposition then goto Process1
167
+
168
+
Constant and Variable: Constant is a fixed value that can’t be changed. On the other hand, the variable is a container for a value that may vary during the execution of the program. For example, in the tea-making algorithm, the cup and kettle are constant whether the water level, water temperature and quantity of tea leaves are variable.
169
+
Developing algorithms using step-form:
170
+
1. START and STOP
171
+
2. INPUT or READ
172
+
3. PRINT
173
+
4. Operators-
174
+
a. Arithmetic Operators: ←; The expression X←6 means that a value 6 is assigned to the variable X. Examples: +, -, *, /, %
0 commit comments