Chapter 1 Computer Class X STBB
Chapter 1 Computer Class X STBB
Introduction to Programming.
What is a Program?
Why we need to code computer?
Various Level of Programming.
Why we should Study C++ ?
What is the difference between C & C++?
Is C++ still valid in this new world of AI.
What we can do with C++ else than passing Exam.
Some real life examples of C++.
Legacy of C++.
2
Distribution of Syllabus
Algorithm.
FlowChart [Block Diagram].
Computer Code.
Digital Logic & Designing DLD.
Scratch Programming.
3
Algorithms
Step by Step brain solution of the Problem.
For Example an Algorithm to add two numbers
Step – 1 . Start [Start the Code]
Step – 2. Declare Number1, Number2, Total [Declare variables]
Step – 3.1 . Write “Enter value for Number 1.” [Take first number as Input]
Step – 3.2 . Read Number1
Step – 4.1 . Write “Enter value for Number 2.” [Take second number as Input]
Step – 4.2 . Read Number2
Step – 5 . Total = Number1 + Number 2 [Addition of two Numbers]
Step – 6 . Write “ Total of Two Numbers is “, Total [Display Result]
Step – 7 . End [End the Code]
4
Three Level of Languages
Low LEVEL Language (Machine Language)
There are two languages known to us as Low Level
Languages or Machine Languages
1. Binary Codes. 2. Assembly Language .
Both are highly manomic /symbolic and complicated.
But used to directly instruct a command to
Machine. Very fast and robust.
We can conclude it as difficult or human but very
easy/fast for Machine.
A 01000001 65 .
5
Binary Code Example
h: 01101000
e: 01100101
l: 01101100
l: 01101100
o: 01101111
6
Assembly Code Example
section .data
hello db 'Hello', 0 ; The string to be printed
section .text
global _start ; Entry point for the linker
_start:
; Write the string to stdout
7
High Level Languages.
BASIC - Beginners All Purposes Symbolic
Instructional Codes.
print “Hello”
. PASCAL:
Write “Hello”;
COBOL : Common Business Oriented Language
Display “Hello”.
8
Intermediate Language / Middle
Class Language
BASIC Beginners
PASCAL Physics
FORTRAN Chemistry
GL Graphics
COBOL Business Accounts
-----65000 Languages = 01 Lang C
C Language (Combination of all)
C++ is en extension to C language.
Easy and robust or machine as well as for human
9
Rules for Writing a C++ Program
1. Whole Program must be coded in lowercase.
2. Every program must be started from a special
function void main().
3. Every-line of the program must be ended on semi-
colon. (;)
4. Every block of the program must be coded in braces
{}.
5. It’s a freefall language so one can code as want to
rows and column rule.
10
Examples of C++
void main()
{
cout <<“ I am here “;
cout<<“ working “;
}
void main()
{cout <<“ I am here “;cout<<“ working
“;}
11