+1 Class Notes
+1 Class Notes
COMPUTER
SCIENCE
3. Pascaline
4. Leibniz’s calculator
5. Jacquad’s Loom
• Developed by Marie Jacqad to simplify the process of manufacturing textiles with complex patterns.
• The loom was controlledby punched cards .
• Multiple rows of holes were punched on each card, with one complete row corresponding to one row of
the design.
• Patterns stored on punched cards could be reused to create the same product.
• It was the First machine that could store information.
6. Difference Engine
7. Analytical Engine
8. Hollerith’s Machine
Generations of Computers
Based on various stages of development computers can be divided into different generations:
1. Machine Language
• It was the first programming language developed to use in computer.
• It consist of strings of binary digits ‘0’ and ‘1’.
• It improved the speed and efficiency of computers.
• It is difficulty to track and correct errors.
• It is highly machine dependable and programmer needs to have high knowledge about the computer
architecture.
•
2. Assembly Language.
• It used English like words to write a program.
• Writing programs becomes easy using Assembly language.
• It is machine dependant and programs written in one computer are not transferrable to other computers.
• EDSAC ( Electronic Delay Storage Automatic Calculator) was the first machine that used Assembly Language.
3. High Level Language (HLL).
• It used English like words and statements to write a program.
• It is very easy to write programs using High Level Language.
• It is a machine independant language and programs are transferrable to other computers.
• A-0 was the first High level language, developed by Grace Hooper for UNIVAC-1.
Theory Of Computation
The branch of Computer Science that deals with how efficiently problems can be solved based on computational models
and Algorithms.
Alan Turing
Turing Machine
EXPAND
• ENIAC (Electronic Numerical Integrator and Calculator) –First general purpose programmable Electronic Computer .
• EDVAC – Electronic Discrete Variable Automatic Computer (Computer with stored program concept)
1. Sign and Magnitude Method - Steps for representing an integer number in sign and magnitude form are:
iii. Add sign bit – add ‘0’ if the number is positive and add ‘1’ if the number is negative , to the lft.
2. 1’S complement Method- Steps for representing an integer number in 1’s complement method/ form are:
ii. Make it of 8 bits by adding 0’s to the left. The 8 bit form is the 1’s complement of Positive Numbers.
iii. If the number is negative , Replace Every 0’s with 1’s and every 1’s with 0’s.
3. 2’S complement Method- Steps for representing an integer number in 2’s complement method are:
B. Make it of 8 bits by adding 0’s to the left. The 8 bit form is the 2’s complement of Positive Numbers.
C. If the number is negative – find its 1’s complement by Replacing Every 0’s with 1’s and every 1’s with 0’s.
➔ A floating point number is represented in floating point notation have two parts- Exponent and mantissa.
➔ In a 32 bit representation , 24 bits are used to represent Mantissa and 8 bits are used to represent exponent. The bits of mantissa
and exponent is to represent its sign.
Representaion of Characters
ASCII
➔ Another version of ASCII , ASCII-8 uses 8 bits and can represent 256 characters.
Unicode
➔ Unicode can represent the all the characters in the written languages of the world
Data: Data denotes the raw facts and figures such as Numbers , words , amount , quantity etc.. that can be
processed as a single unit
Data Processing :
Data processing refers to the operations or activities performed on data to generate information.
1.Capturing data. → 2. Input of data. → 3.Storage of data. → 4. Processing of data. →5. Output of Information
→ 6.Distribution of Information.
1. Capturing Data
• During this stage , a source document is designed to collect data in proper order and format , which is used
for data collection.
2. Input of Data
• During this stage , the input data collected through the source document is fed into the computer for
processing.
3.Storage
• The input data before processing , The intermediate result while processing and the information after
processing are stored.
4. Process
• Various operations like calculations ,classification ,comparison ,sorting , filtering etc are carried out as part
of processing.
5. Output
6. Distribution of Information
• The information obtained from the output stage is distributed to the benificiaries for decision making and
problem solving.
According the Von Neumann Architecture , The functional units of a computer consist of :- Input Unit ,Central
Processing Unit (CPU) ,Storage Unit and Output Unit.
The Central processing Unit consist of Control Unit , Arithmetic and logic unit (ALU) and Registers
• Input Unit :
• The collected data and instructions are entered into the computer through the input unit.
•It is the brain of computer. All major computations and calculation are made within the CPU.
➢ Control unit : it is the central nervous system that control and coordinates all the operations of a
computer. It involkes all other units to perform the operations they are associated with.
➢ Registers :Registers are the temporary storage locations inside the CPU.
• Storage Unit
• The input instructions before processing , intermediate results while processing after the results after
processing are stored in the storage unit.
• The two types of storages are Primary Storage and Secondary Storage.
• Output Unit :
• The information obtained after data processing is supplied to the outside world through the output
unit.
Hardware
• The visible and tangible parts of a computer system that consist of some electrro mechanical component
are called Hardware.
• The physical devices that constitute a computer are collectively called Hardware.
Processor
• It is an Integrated Circuit package that contain millions of transistors and other components fabricated
into a single silicon chip.
• It co-ordinates all computing and decision making operations of a computer.
• Performance of a Processor determines the overall performance of the computer.
• Eg: Intel Core i3 , i5 ,i7 , AMD Quadcore , AMD Ryzen .
Registers
• Registers are the temporary storage locations inside the CPU to store data and instructions..
• Contents of Registers can be accessed more quickly by the CPU.
• Important Registers inside a CPU are :
▪ Accumulator – Accumulator Register is a Part of ALU and is also known as Register A . It is
used to store intermediate results of Arithmetic and logical operations.
Motherboard
Mother board is the large printed circuit board(PCB) to which major components of a computer are integrated.
Peripherals
Peripherals are devices which are attached to a computer system to improve (enhance) its capabilities. It includes
Input/output devices, Storage devices, Communication devices etc...
Ports
Ports are used to connect external devices such as to a computer. Ports on the motherboard are VGA , PS/2 ,
USB , Ethernet ,HDMI etc.
Memory
Memory is a a collection of storage locations to store data and instructions temporarily or permananently.
Binary Digit –Bit 1 Nibble – 4 Bit 1 Byte – 8 Bits 1KB (Kilo Byte) =1024 Bytes 1MB(Mega Byte) =1024 KB
1GB (Giga Byte) = 1024 MB 1TB( Tera Byte) =1024 GB 1PB (Peta Byte) =1024 TB.
Primary memory
Primary memory is a high speed semiconductor memory that is directly accessed by the CPU. Primary memory
includes three types of memory – Random Access Memory(RAM) , Read Only Memory(ROM) and cache memory.
• RAM refers to the main memory that processor can read from and write into.
• Data can be retrieved from any location within the RAM.
• Data or Instructions to be executed by CPU must be placed in the RAM.
KALLADI HSS NOTES BY MUSTHAFA 9544885401
• RAM is a Volatile Mobile – Contents of RAM is lost when power is switched off.
• It stores the Operating System , Application Programs and data when the computer is functioning.
Cache Memory
• Cache memory is a small and fast memory between the processor and RAM.
• It stores frequently accessed data , instructions , intermediate results etc..
• When processor needs data, it first searches in the cache.
Input devices
1. Keyboard
• It allows user to input alphabets ,numbers, and other characters to the computer.
• Keyboard can be wired or wireless which can be connected to the computer through PS2/USB port or
Bluetooth,IR,Radio.
• Keyboard detects the key pressed and generates the corresponding ASCII number to store in memory.
2. Mouse
• Mouse is used to control the movements of a cursor on the computer screen.
• Mouse has one more than one buttons and a scroll wheel.
Buttons are to make selections and scroll wheel is to scrolling on the screen.
• Wired mouses are connected through PS2/USB ports and wireless mouses are connected throuhgh
Radio waves.
• Different types of Mouse are : Ball Mouse , Optical Mouse and Laser Mouses.
3. Light Pen
• Light pen is a pointing device that Helps to draw directly on the screen
• Light Pen is used to draw pictures, design objects and also put digital signatures directly on the
screen.
• Used by engineers, Fasion Designers ,Artists etc.
4. Touch Screen
• Touch screen is Operated by touching on the display screen.
KALLADI HSS NOTES BY MUSTHAFA 9544885401
• It have touch sensitive display screens.
• Used in Smart phones, Laptops, ATMs etc
5. Graphic Tablet
• It consists of an electronic writing area.
• Special pen works on it which is pressure sensitive.
• It allows artists to create graphical images with motions and actions
6. Joystick
• It is a pointing device used to select and move objects on the screen.
• Mainly used to play games, and controls robots..
• It have a vertical movable stick and control button.
7. Microphone
• It is used to input sound to the computer.
• It accept sound which is analog and convert it into digital format .
8. Scanner
• scanners are used to scan images and texts and convert into digital format.
• Quality of image depends on the resolution of scanner, which is expressed in DPI.
• Different types of scanners are- Flat bed, Sheet feed,and hand held.
9. Optical Mark Reader (OMR)
• OMR is used to scan printed forms, read predefined positions and record marks on the form.
• It is used to evaluate objective type exam papers.
10. Barcode / QR code (Quick Response) code Readers
• Barcode is a set of vertical lines of different thickness and spacing that represent a number.
• Barcode readers are devices that are used to input data from barcodes.
• QR codes are two dimensional lines of different thickness and spaces.
• QR code reader is used to input data from QR codes.
• Bar codes are single dimensional where QR Codes are two dimensional.
11. MICR – Magnetic Ink Character Recognition
• MICR is used to read the characters printed using iron oxide particles below the cheques, drafts etc
• MICR is used to read MICR code that contains cheque number, branch code, bank codes etc..
12. Biometric Sensors
• Biometric sensor is a device that can identify unique human features such as fingerprints,retina ,
iris patterns ..
• It is used to verify and authenticate the identity of humans.
13. Smart Card Reader
• Smart card is a plastic card that contain memory or microprocessor which can store and transact
data.
• The smart card is used in banking, health care, telephone calling etc.
• Smart card reader is used to read data from smart cards.
14. Digital camera
• A digital camera can take pictures and videos and convert them into digital format.
• It have the facility to store captured images / videos.
Commonly used Output Devices are : Visual Display Unit, LCD Projector,Printer,Plotter, 3D Printer ,Audio Devices.
▪ VDU is used to display the Information generated by the computer in pictorial form.
▪ Information displayed on Display devices are called Soft Copy.
▪ Size of monitor is measured diagonally across the screen.
→LCD Projector
▪ LCD projector is a type of Video projector that is used to display images, video or computer data on a large
screen.
▪ It uses a lens to focus the high intensity beam of light from the projector to a screen.
→Printers
• Plotter is used to print Hard copies of large format graphs ,maps , drawings , designs etc.
• Plotter can be Drum plotters or flatbed plotter.
→3D Printer
e-waste
• E-waste refers to the Electronic products nearing the end of their ‘useful life’.
• The e-waste includes discarded Televisions , Computers, Laptops , DVD players , Fax machines etc
• It is estimated that 50 million tons of e-Waste are produced each year
• It contains some very toxic substances, such as mercury, lead, cadmium, brominated flame retardants,
etc.
• The toxic materials can cause cancer, reproductive disorders and many other health problems, if not
properly managed.
The e-waste disposal methods are: 1.ReUse 2.Incineration 3.Recycling of E-waste 4.Land filling
→ReUse
• It is the Second-hand use of electronic products or usage after it has been upgraded or modified.
• Old computers are passed on to relatives/friends or returned to retailers for exchange or for money.
• Computers can be passed to charitable institution or educational institutions.
• This method reduces the volume of e-Waste generation.
→Incineration
→ Recycling of E-waste
• It is the process of making or manufacturing new products from a product that has originally served its
purpose.
• Monitors, Keyboards, Laptops, Modems, Telephone boards, Hard drives, Compact disc, Mobiles, Fax
machines, Printers, CPU, Memory Chips, Connective wires and cables can be recycled.
→ Land filling
• It is one of the widely used but not recommended method for the disposal of e-Waste.
• It is the process of dumping the e-waste in to the soil.
• The environmentally responsible and eco-friendly use of computer and their resources are called Green
computing.
• It is the designing , manufacturing, using and disposing of computers and associated components such as
monitors, printers, storage devices, etc., efficiently and effectively with minimal or no impact on the
environment.
To promote green computing the following four complementary approaches are employed.
Energy star
The labelling programme to promote energy efficiency in computers and their resources is called Energy star.
Software
• It is a set of instructions that enables the user to interact with a computer and perform operations.
• Software is a set of instructions/program to perform a specific task
• Softwares are classified in to two.
1) System Software
2) Application Software.
System Software
Operating System
•Device Management- Responsible for managing the devices attached to the computer.
Computer Languages
• Low Level Language(LLL)
• Machine Language: It uses the binary digits 0 and 1 to write a program.It is the Only Language that
machines can understand.
• Assembly Langauge :It uses mnemonics codes like ADD,SUB,INC,etc to write a program. Mnemonics are
the symbolic name assigned to operations.
• High Level Language(HLL) : HLL uses english language lijke words to write programs .
Language processors
• Language processors are the programs that translate programs written in Assembly language or High
level language into its equivalent version in Machine language.
• They are classified in to three.
1. Assembler : Assembler is a program that converts programs written in assembly language into machine
language instructions
2. Interpreter: Interpreter is a program that converts programs written in High Level language into its
equivalent instructions in machine language , line by line.
3. Compiler: Compiler is a program that converts programs written in High Level language into machine
language instructions.
Compiler Interpreter
Utility Software
• Utilities are the set of programs for performing system maintanance tasks and for performing tasks of
routine nature.
1. Backup Utility : - Backup means duplicating the disk information and store it else where , so that it can be
used to restore the original after a data loss.
2. Compression Tools: - Compression tools are used to compress and decompress data files.
3. Disk Defragmenter : Disk defragmenter is a program that is used to arrange the files on the Hard disk.
4. Antivirus software – Antivirus softwares are used to scan the computer for known viruses and removes
them.
Application Software
• Software developed for a specific application is called Application is called Application Software.
• General Purpose Softwares are used to perform tasks in a particular application area.
KALLADI HSS NOTES BY MUSTHAFA 9544885401
• Such softwares are developed according to the requirements of the expected users.
5.Database Software.
• Word processors : Word processing softwares are designed to create , modify and edit text documents.
• Spreadsheet Software: Spreadsheet sofware allows users to store and organize data in tabular form and
to perform calculations.
• Presentation Software: Presentation Softwares are used to display information in the form of slide show.
• Multimedia Software:Multimedia softwares includes the softwares to play and edit Audio , Video ,Image
files.
• Database Software: Database is an organised collection of inter related data. Database Software is used to
create and manage databases.
• Specific purpose softwares are developed according to the requirements of an Organization or individuals.
• Example: Pay roll System , Air line reservation System , sales and inventory control System, Hospital
management System, Library management System, Supermarket management System etc…
• Free and Open Source software provides freedom to Use ,Copy,Distribute,Examine ,Change and Improve
the software.
• The four freedoms for free and open source software are:
2. GIMP(GNU Image Manipulation Program) :- Free and open source image editing sofware.
Proprietary Softwares
• Softwares that are exclusive property of its developer ,which cannot be used,copied or distributed
without licensing agreements.
Humanware/Liveware
• Humanware is the term used to refer the humans who use computer system.
• Eg: Computer System Administrators, System Manager ,Database administrators, Computer
Engineers, Computer Operators , System Analyst
1. Syntax Errors : Syntax error occurs when the Rules or Syntax of a programming language are not followed.
Eg: Semi column ( ; ) missing in a statement.
2. Logical Error : Logical error occurs due to the incorrect logic used in the program.
Computer produces output as per the instruction given by the user . But the obtained output will be
incorrect . This type of errors are known as Logical error.
Eg: Use + symbol for Multiplication instead of *.
3. Run time Errors: Run time error occurs due the inappropriate input given by the user given by the user
during the run time. Eg: Dividing by Zero error.
Algorithm
KALLADI HSS NOTES BY MUSTHAFA 9544885401
Step by procedure to solve a problem is called Agorithm.
Characteristics of Algorithm
Flow Chart
1. Terminal :
It is used to represent start and stop instructions. Its Symbol is Ellipse
2. Input /Output
It is used to represent input instructions and Output Instructions. Its symbol is Parallelogram.
3. Process
It is used to represent Assignment Instructions (=). Its symbol is Rectangle.
4. Decision
Decision is used to represent decision making instructions. Its symbol is Rhombus.
5. Flow Lines
Flow lines are used to represent flow of instructions . Its symbols are arrows with heads.
6. Connectors
Connectors are used to represent a single flow chart that spread on multiple pages.
• The performance of an algorithm is evaluated based on the concept of Time Complexity and Space
complexity.
• An algorithm which will be executed faster by using minimum memory space is considered as the efficient
algorithm.
1. Top Down Design approach : Here a large problem is divided into smaller sub problems. And some of the
sub problems are further sub divided. Then each sub problems are solved separately.
2. Bottom Up design approach: Here a large problem is divided into smaller sub problems. And each sub
problems are further sub divided until the lowest module . The problem is solved by integrating the
solutions to individual sub problems.
The set of valid characters that a language processor can recognize are called Character set. The c++ character set
is categorized into five:Letters,Digits,Special Characters,White spaces and All the 256 ASCII characters.
Tokens
Tokens are the fundamental building blocks of a program.They are also known as Lexical Units. The 5 types of
tokens in c++ are :
Keywords
Keywords are the Reserved words that convey a specific meaning to the language compiler. Keywords should be
in lower case characters. Keywords in c++ are:
asm,auto,break,case,catch,char,class,const,continue,default,delete,do,double,extern,enum,else,float,for,friend,got
o,if,inline,int,long,new,operator,public,protected,private,register,return,short,signed,sizeof,static,struct,switch,tem
plate,this,throw,try,typedef,throw,union,unsigned,virtual,void,volatile,while.
Identifiers
The user defined names that are used to name different program elements such as memory locations ,statements
,functions ,class ,objects are called Identifiers.
Literals / Constants
Tokens to represent data items that never change their value during the execution of the program(program run)
are called Literals/ Constants. Four types of Literals are:
1. Integer Literals.
3. Character Literals.
4. String Literals.
Integer Literals
The whole numbers without decimal part that never change their value during the execution of the program are
called integer literals.
1) Integer literals must have one digit and must not contain any decimal point.
2) The first character may be ‘+’ or ‘-‘ sign ; where + indicates positive number and – indicates negative
number.
The numbers having fractional part that never change their value during the program run are called Floating point
Literals or Real constants.
Floating point literals can be represented in two forms – Fractional form and Exponential form.
Floating point literals in Fractional Form :- It consist of signed or unsigned digits with a decimal point between
the digits. The rules for writing / characteristics of Real constants in fractional form are :
2. The first character may be ‘+’ or ‘-‘ sign ; where + indicates positive number and – indicates negative
number.
Floating point Literals in Exponential form :- It consist of Two parts. Exponent and mantissa.
The rules for writing / characteristics of Real constants in Exponential form are:
1. The floating point literal in exponential form have two parts – Exponent and mantissa.
Character Literals
A single character enclosed in single quote that never changes its value during the program run are called
Character literals.
Escape Sequences
Escape sequences are used to represent some non-graphic character constants which cannot be typed directly
from the keyboard. It consist of a black slash followed by one or more characters. Escape sequences are listed in
the following table:
String Literals
A sequence of one or more characters enclosed within a pair of double quotes is called String Literals.
Operators
The symbols that tells the compiler to perform some operation are called Operators. The participants in an
operation are called Operands.
• Arithmetic operator : +, - ,* , / ,%
Punctuators are Special symbols that have syntactic and semantic meaning to the compiler. Punctuators in c++ are
# ; ‘ ‘’ ( ) { } [ ].
IDE are used to develop programs . IDEs provide facilities to Type , Edit , Compile , Link and Execute c++ programs.
GCC (GNU compiler collection) ,Borland C++ , Turbo C++ are examples.
GCC compiler is a free software available with Linux Operating System. Geany is a platform independent IDE for
writing , compiling and Executing c++ programs.
• Saving a File : File → Save or press ‘Cntr + S’ →Give file name with .cpp extension.
Previous Questions
1. Classify the following into different Tokens:
Ans : cout - Identifier << - Operator “, ; - Punctuators. “The missile Man” – Literal
Number1 - Valid
Summer – Valid.
do Sum 5 + #
• C++ Data types are classified into – Fundamental DataTypes , Derived data Types and User
defined Data Types.
Fundamental Data Types / Primitive data Types / Basic Data Types /Built-In Data
Types
Fundamental data types are the Built-in data types that defined in the c++ compiler. The fundamental
data types in c++ are int , char , float , double and void.
1. int Data type
• Range of values that int data type can represent is from -2147483648 to 2147483647.
• 256 , -2548 ,0 , 450000 are example for int type data items.
2. char data type
• char data type is used to represent characters defined in the c++ character set.
• Double data type is used to represent double precision floating point numbers.
Type Modifiers
Type modifiers or Data Type Modifiers are used to alter the Size , Range or Precision of Fundamental
Data types. The Type modifiers are signed , unsigned , long and short.
Eg:
• Size of ‘int‘ data type is 4 Bytes . When it becomes ‘ short int’ size becomes 2 bytes.
• Range of int is from -2147483648 to 2147483647 . When it becomes ‘unsigned int’ , the
range becomes 0 to 4294967295.
Variables
• These names are used to refer the memory location to store and access the data.
• The three aspects associated Variables are – Variable name , Memory Address and Content.
• Memory Address – The address of a variable is the starting address of the allocated memory
space.It is also called L-value of a variable.
Operators
• Operators are the predefined symbols that trigger(tell) the computer to perform some operation.
• Based on the Number of operands in operation, operators are classified into – Unary , Binary
and Ternary.
• Unary operator – An operator that operates on a single operand is called Unary operator.
Eg : unary + , unary – , Increment operator (++) , Decrement operator (- -) etc.
• Binary operator - An operator that operates on two operands is called Binary operator.
Eg: Arithmetic operators (+,-,*,/ ,%) , Relational operators (<,<= ,>,>=, ==,!=) etc…
• Ternary operator - An operator that operates on three operands is called Ternary operator.
Eg :Conditional operator(? : ).
Classification of Operators
Based on the nature of operation , operators are classified into :
1. Arithmetic Numbers- + , - , * , / and %.
2. Relational Operators.- <, > , <= , >= , == ,!=
3. Logical Operators- && , || ,!
4. Assignment operator.- =
5. Arithmetic Assignment Operator- += , -= , *= , / = and %=.
6. Input / Output Operator.-<< , >>
7. Increment and Decrement Operator. ++ , --
8. Conditional Operator.- ? :
9. Sizeof Operator
Arithmetic Operators
Arithmetic operators are used to perform basic arithmetic operations such as Addition , Substraction ,
Division , Multiplication , and Modulus . Arithmetic operators are + , - , * , / and %.
Eg : x=10 , y=5.
Operator Operation Result
- x-y 5
* X*y 50
/ x/y 2
% X%y 0
Logical Operators
Logical operators are used to combine two relational expressions and to compare them. Logical
operators produce either True or false as Result. The Logical Operators are &&(Logical AND ) , ||
(Logical OR) , ! (Logical NOT).
• || (Logical OR)
• || (Logical OR)
It compare two relational expressions and produce result as True (1) if any one of the expression is true
.It produce result as False(0) if both the expressions are false.
True False
False True
Eg: x=10;
! (x>20) → True
Assignment Operator
Assignment Operator is used to assign a value to a variable.The Assignment operator is ‘=’. It is a binary
operator in which the first operand musrt be a Vriable . The second operand can be variable or any
constant.
Synatx: Variable = Value; eg: n=3;
Variable1 = Variable2 eg: x=n;
Arithmetic Assignment Operator
Arithmetic Assignment operator performs an arithmetic operation and assign the result to the first
operand. The Arithmetic assignment operators are += , -= , *= , /= , %= .
• a=3 → stores the value 3 in the • a==3 → Check whether the value
variable a stored in a is 3 or not.
• The value of operand is incremented by one and the incremented value is used.
• The current value of operand is used and then the value is incremented by one.
• The value of operand is decremented by one and the decremented value is used.
• The current value of operand is used and then the value is decremented by one.
• The first operand will be a test expression and the remaining can be values or expressions.
• If the test expression is true the second operand will be selected and the third operand will be
selected if the test expression is false.
Syntax :- Expression1 ? Expression2 : Expression3 ;
Eg: 1) (mark>30) ? cout<<”passed” : cout<<“Failed”; or cout<<(mark>30) ? ”passed” :
“Failed”;
or x= ( mark>30) ? ”passed” : “Failed”;
2) (numbe%2==0) ? “Even” : “Odd” ;
• It is an unary operator.
• Sizeof operator returns the amount of allocated memory space for the operand in bytes.
• Syntax:
✓ sizeof (datatype); eg: sizeof(int); → returns 4.
✓ Sizeof variableName; eg : char x;
sizeof x ; → returns 1.
✓ sizeof constant ; eg: sizeof 3.5; →returns 8 , since floating point values are treated
as double data type.
Precedence of Operators
Precedence of operators refers to the priority of operators for execution in an operation.
Priority Operators
1 Parenthesis ()
3 Binary Operators
Arithmetic ioperators *, / , %, + , -
4 Conditional operator ?:
6 Comma ,
Eg : 7+8-3*8
7+8-3*8 → 7 + 8 – 24 → 7 + 8 – 24 → 15-24 → -9.
Expressions
• An Expression is the combination of operators and operands.
• An expression in which only Arithmetic operators are used is called Arithmetic Expression .
• An Expression that contains any one of the Logical operator is called Logical Expression.
• It combines two or more relational expressions and produce either True or false as result.
KALLADI HSS NOTES BY MUSTHAFA 9544885401
• Eg:
1) (x > y) && (y!=20)
2) ! (x==0)
Statements
• Statements are the smallest executable unit of a programming language.
• Synatx :
1) Variable = Constant ; Eg : x=10;
2) Variable1= Variable2; Eg : y=x;
3) Variable =Expression ; Eg : z= x + y;
4) Variable = Function(); eg : x= sqrt (25);
→Input Statement
• Input statement is used to store data in memory during the program execution.
• The Extraction /get from operator - >> is used for for input operation along with the object
• Since keyboard is the standard input device , cin is used as stream object.
→Output Statement
• Output statement is used present some data /result to the user through an output device.
• The insertion / put to operator - << is used for output some data.
• Syntax :
StreamObject >> data :
• Since Monitor is the standard output device , cout is used as the stream object.
• Eg:
1) Cout<<”welcome ”; //prints welcome on screen
2) Cout<<”x” ; // prints x on screen
3) Int x;
X=10;
Cout<<x; // print the value of x on screen , ie, 10.
Type Conversion
• The process of converting the data type of an operand into another data type is called Type
Conversion.
• The process of converting the data type of lower sized operand into higher sized operand is
called Implicite type conversion.
• The process of converting the data type of result into a desired data type by the programmer is
called Explicite type conversion.
• It is the explicit type conversion and is done by the programmer by specifying the data type
within parentheses to the left of the operand.
Variable Initialisation
• Supplying value to a variable at the time its declaration is called variable Initialisation.
• Syntax:
DataType variable = Value ;
• ‘const’ access modifier is used to create symbolic constants whose value can never be
changed during the program execution.
2) Int a=5,b=2;
Float p;
P=a/b; // p =5/2 → p=2 → p=2.0 ( 2 is converted to the data type of RHS – p ,ie,float 2.0)
Structure of a c++ program
The structure of a c++ program is :
#include <iostream>
int main ()
Statements ;
return 0;
Preprocessor Directive
• It instructs the compiler to process the information provided before the actual compilation starts.
• #include is used to link the header files from c++ library to our program.
• Header files contain Information about Predefined functions , objects ,data types etc.
• The header file < iostream> contains the information about the objects cin and cout.
• It tells the compiler about a namespace where it should search for the elements used in the
program.
• The identifiers like cin , cout are defined in the standard namespace std.
main() function
• Every program execution starts from and end within main() function.
• Two types of comments are – Single line comment and Multiline comment
• Single line comment - Single line comments are written after //.
• Multiline comments – Comments that take more than one line are written within /* and */.
Guidelines for Coding
Programs
1. Program to Print your Name and address
#include<iostream> //link the header file iostream with our program
Using namespace std; //makes available the identifiers cin, cout to our
program.
int main()
return 0;
{ 20
cin>>num1>>num2;
sum=num1+num2;
cout<<”sum is : “<<sum;
return 0;
Control Statements
The statements that change the sequential flow of execution of a program are called Control Statements.Control
statements are classified into :
if Statement
• If statement is used to select a block of statements for execution when a particular condition is true.
• The condition (Test Expression) will be a Relational or Logical Expression .
if ( mark <=30)
if ( Test expression) {
{ cout<<”Passed”;
Statements ton be }
executed when the
Test Expression is true;
}
If….else Statement
• If statement is used to execute a block of statements when a particular condition is true and execute
another block of statement when the given condition is false.
• If .. else statement execute the first block of statements if the given test expression is true and skip the
else block.
if ( mark <=30)
if ( Test expression) {
{ cout<<”Passed”;
Statements ton be }
executed when the else
Test Expression is true; {
} cout<<”Failed”;
else }
{
Statements ton be
executed when the
Test Expression is false;
}
Program to check whether the Program to find the largest among two Program to check whether the
student is passed or failed. Numbers/Heights/Marks given Number is Even or Odd.
Nested if Statement
An if statement placed within another if statement is called Nested if statement .Nested means one inside
another.
#include <iostream>
using namespace std;
int main()
{
int N;
cout<<”Enter a number :”;
cin>>N;
if ( N != 0)
{
if (N >0)
cout<<”It is a Positive Number”;
else
cout<<” It is a Negative Number”;
}
else
{
cout<<”it is a Zero”;
}
return 0;
}
return 0;
}
else if ladder
• The else if ladder consist of single if statement , multiple else-if statements and a single else statement.
• Different conditions will be given and each condition will decide which statement is to be executed.
• Syntax:
if ( Test expression)
True_case statements1;
else if (Test Expression2)
True_case statements2;
else if (Test Expression3)
True _case statements 3 ;
.
.
.
else
False_Case_Statements;
Program To print the day of the week Corresponding Program to Check whether the given Character is a Vowel
to the number between 1-7 or Not
Switch Statement
• Switch statement is used to successively tests the value of a variable or an expression against a list of
integer or character constants.
Syntax:
switch(Expression/Variable)
{
case constant_1 : statement_Block1 ; break ;
case constant_2 : statement_Block1 ; break ;
case constant_3 : statement_Block1 ; break ;
.
.
case constant_N : statement_Block1 ; break ;
default : Default_statement ;
}
Program To print the day of the week Corresponding Program to Check whether the given Character is a
to the number between 1-7 Vowel or Not
1. Initialization Statement: - It is the step of giving first value to the loop control Variable. It will
execute only once.
2. Test Expression : It is a Relational or Logical Expression which decides whether the body of loop is
to be executed or not.
3. Update Statement :- It is the step of changing the value of loop control variable before the next
iteration.
4. Body of Loop :- It is the one or more statements that is to be executed repeatedly
while statement
• It is an entry controlled loop that repeatedly execute a block of statements when a condition is true.
• The condition is checked first and the body of the loop will be executed only if the condition is True.
False →4 Flase →4
do – while loop
• It is an exit controlled loop that repeatedly execute a block of statements when a condition is true.
• The body of the loop will be executed first and then the condition is checked. iteration will continue only
when the condition is true.
Syntax Example Data Flow diagram
1
False →4 Flase →4
for Loop
• It is an entry controlled loop that repeatedly execute a block of statements when a condition is true.
• The condition is checked first and the body of the loop will be executed only if the condition is True.
• In for loop the Initialization statement , Test Expression and Updation Expression are included in a single
statement.
• Case 1: When semicolon is placed after the loop statement , the body of the loop will execute only when
the test expression becomes false.
KALLADI HSS NOTES BY MUSTHAFA 9544885401
Eg: for ( k=1 ; k<=5 ; k++ );
cout<<k; // It produce Output as 6
• Case 2: When the initialization expression is not given , the loop control variable will assign some random
value. Since the output cannot be Predicted.
• Case 3: When the updation expression is not given , the loop will never be terminated. it will work
infinitely.
• Case 4: When the Test expression is not given , it will treated as True and the loop will execute infinitely.
Nesting of Loops
• Placing a loop inside the body of another loop is called Nesting of a loop.
• When we nest two loops , the outer loop counts the number of completed repetitions of inner loop.
• Loop control variables for each loop must be different.
*
* *
***
* ** *
#include <iostream>
using namespace std;
int main()
{
int N,i,j,;
cout<<”Enter a number of Rows :”;
cin>>N;
for ( i =1 ; i <=n ; i ++)
{
for ( j=1 ; j <=i ; j ++)
{
cout<<” * ”;
}
cout<<”\n”;
}
return 0;
}
• return statement is used to transfer the program control back to the calling function .
• exit() function is used to terminate a program. exit() function is defined in the header file <cstdlib>
1. goto Statement
goto statement is used to transfer the program control to a labeled location. labels are the identifiers given to statements.
2. break Statement
break statement is used to takes the program control outside the looping or switch statement.
3. continue statement
continue statement is used to bring the program control to the beginning of the loop by skipping the rest of the statements
within the block. It stops current iteration and starts the next iteration.
Program Gallery
while loop do-while loop for loop
Program to print Natural Program to print Natural Program to print Natural
Numbers upto 100 Numbers upto 100 Numbers upto 100
Program to find the factorial of a number using for Program to find the Sum and average score of N
loop. [ 5! = 1*2*3*4*5] students.
Program to check whether the given number is Program to Print the N terms of the Fibonacci
prime or Not. series.
[ 0 1 1 2 3 5 8 13 21…..]
#include <iostream>
#include<cstdlib>
using namespace std; #include <iostream>
int main() using namespace std;
{ int main()
int i ,N; {
cout<<”Enter the Number :”; int i ,N, first = 0, second = 1 ,third;
cin>>N; cout<<”Enter the Number of terms:”;
for( i=2 ; i<N/2 ; i++) cin>>N;
{ cout<<first<<”\t”<<second;
if ( N% i ==0) for( i=2 ; i<=N ; i++)
{ {
cout<<”Not a prime Number .”; third = first +second;
exit(0); cout<<third;
} first = second;
} second = third;
cout<<”Prime Number”; }
return 0;
} return 0;
}
Program to find the sum of digits of a Number Program to check whether the given number is
Pallindrome or Not.
#include <iostream>
using namespace std; #include <iostream>
int main() using namespace std;
{ int main()
int num , digit , sum=0; {
cout<<”Enter a Number :”; int num , digit , rev=0;
cin>>num; cout<<”Enter a Number :”;
while ( num >0) cin>>num;
{ t=num;
digit = num%10; while ( num >0)
sum = sum+digit; {
num= num/10; digit = num%10;
} rev = rev*10+digit;
cout<<”Sum is:”<<sum; num= num/10;
}
KALLADI HSS NOTES BY MUSTHAFA 9544885401
return 0; if ( t == rev )
} cout<<”It is palindrome ”;
else
cout<<”It is Not Pallindrome”;
return 0;
}
ARRAYS
→Array
• An array is a collection of elements of the same type placed in continuous memory locations.
• Array is a single variable that can store multiple values of same type.
• Arrays are used to store same type of values under a single variable name.
• Each element in an array can be accessed using its position in the list, called index number or subscript.
• Each item in an array is called an element of the array.
→ Declaring arrays
Data_type Array_name[size];
• Data_type can be any fundamental data type (int , char , float, double) , which determines the type of
data that array can store.
• Array_Name is the identifier for naming the Array.
• Size is any positive Number , which determines the maximum number of elements that array can store.
char Name[15];
float mark[60];
int num[10];
➔ Elements within the array can be accessed by giving the array’s name and the element’s position. This
position is called the index or subscript value.The array index starts with zero.
➔ The First element within the array can be accessed as : Array_name[0];
➔ The 10th element within the array can be accessed as : Array_name[9];
➔ The 75th element within the array can be accessed as : Array_name[74];
➔ The Nth element within the array can be accessed as : Array_name[N-1];
The total Memory space allocated for an array can be calculated as:
KALLADI HSS NOTES BY MUSTHAFA 9544885401
Total Memory allocated = sizeof (array_data_type) × size_of_array
Memory allocation for the array mark = sizeof ( int ) x size of array
= 4 x 60 = 240 Bytes.
Q? Calculate the memory allocation for the array : char name [25];
Ans : Memory allocation for the array mark = sizeof ( char ) x size of array
= 1 x 25 = 25 Bytes.
Q? Calculate the memory allocation for the array : float weight [40];
Array initialization
An array can be initialized in different ways:
The sum of all the elements within the array can be calculated as :
• Reading an Array
Consider an Array ‘Ar’ with N elements .It can be read as :
cin>>Ar[i];
cout<<Ar[i];
#include <iostream>
using namespace std;
int main()
{
int i, ,N, Ar[50];
cout<<”Enter the number of elements:”;
cin>>N;
return 0;
Array Operations
Different operations that can be performed on Array are:
• Traversal.
• Insertion.
• Deletion.
• Searching.
• Sorting.
• merging.
Traversal
#include <iostream>
using namespace std;
int main()
{
int i, ,N, Ar[50];
cout<<”Enter the number of elements:”;
cin>>N;
return 0;
Sorting
• Sorting is the process of arranging the elements of the array in some logical order.
• The logical order may be ascending or descending in case of numeric values or alphabetical order in case
of strings.
• Different sorting Algorithms are: - Bubble Sort and Selection Sort
Bubble sort
Initial list
23 12 7 11 4
Pass 1
Pass 2
Pass 3
KALLADI HSS NOTES BY MUSTHAFA 9544885401
Pass 4
• In bubble sort, to sort a list of ‘N’ elements,we require (N-1) passes. In each pass the size of the revised list
will be reduced by one.
Step 5: Repeat Step 6 until the second last element of the list
Step 6: Starting from the first position, compare two adjacent elements in thelist. If they are not in proper
order, swap the elements.
Step 7. Revise the list by excluding the last element in the current list.
Step 9. Stop
Selection sort
• Selection sort algorithm starts by finding the minimum value in the array and moving it to the first position.
• At the same time, the element at the first position is shifted to the position of the smallest element.
• This step is then repeated for the second lowest value by moving it to the second position, and so on until the
array is sorted.
• The process of finding the smallest element and exchanging it with the element at the respective position is
known as a pass.
• For ‘n’ number of elements there will be ‘n – 1’ passes.
Initial list
32 23 10 2 30
Step 5.: Assume the first element in the list as the smallest and store it in MIN and its position in POS
Step 7: Compare the next element in the list with the value of MIN. If it is found smaller, store it in MIN and its
position in POS
Step 8: If the first element in the list and the value in MIN are not the same, then swap the first element with the
element at position POS
Step 9: Revise the list by excluding the first element in the current list
{
#include <iostream>
MIN=AR[i];
using namespace std;
POS=i ;
int main()
for(J = i+1; J < N; J++)
{
if(AR[J]<MIN)
int AR[25], N, i, J, MIN, POS;
{
cout<<"Enter the number of elements : ";
MIN=AR[J];
cin>>N;
POS=J;
cout<<"Enter the array elements: ";
}
cin>>AR[i]; {
AR[POS]=AR[I];
AR[i]=MIN;
cout<<AR[i]<<"\t";
return 0;
Searching
• Searching is the process of finding the location of the given element in the array.
• The search is said to be successful if the given element is found, that is the element exists in the array;
otherwise unsuccessful.
• There are basically two approaches to search operation: linear search and binary Search
Linear search
• Linear search or sequential search is a method for finding a particular value in a list.
• Linear search consists of checking each element in the list, one at a time in sequence, starting from the
first element, until the desired one is found or the end of the list is reached.
• Consider an Array ‘Ar’:
30 45 23 56 98 74
Let the item to be searched be 56. Then Linear search works as follows:
Ar [0] == Item → 30 == 56 - false
KALLADI HSS NOTES BY MUSTHAFA 9544885401
Ar [1] == Item → 45 == 56 - false
Ar [2] == Item → 23 == 56 - false
Ar [3] == Item → 56 == 56 - true. → it returns the Location 4.
Binary search
• Binary search is an algorithm which uses minimum number of searches for locating the position of an element
in a sorted list.
• It performs searching by checking the middle element , eliminating half of the list from consideration, and
then performing the search on the remaining half.
• If the middle element is equal to the searched value, then the position has been found; otherwise the upper
half or lower half is chosen for search, based on whether the element is greater than or less than the middle
element.
Step 1: Start
Step 2: Accept a value in MAX as the number of elements of the array
Step 3: Accept MAX elements into the array AR.
Step 4: Accept the value to be searched in the variable ITEM
Step 5: Store the position of the first element of the list in FIRST and that of the last in LAST
Step 6: Repeat Steps 7 to 11 While (FIRST <= LAST)
Step 7: Set MID= (FIRST + LAST)/2 .
Step 8: IF ( AR [MID] == ITEM) THEN , display the position and go to Step 12.
Step 9: ELSE IF ( AR [MID] < ITEM) THEN set LAST = MID - 1
Step 10: ELSE IF ( AR [MID] > ITEM) THEN set FIRST = MIDDLE + 1
Step 11: Stop
Program for Binary search
#include <iostream>
using namespace std;
int main()
{
int AR[25],MAX;
int FIRST, LAST, MID, I, ITEM, LOC=-1;
cout<<"Enter the Number of Elements: ";
cin>>MAX;
cout<<"Enter array elements in ascending order: ";
for(I=0; I<MAX; I++)
cin>>AR[I];
cout<<"Enter the item to be searched: ";
cin>>ITEM;
FIRST=0;
LAST=MAX-1;
while(FIRST<=LAST)
{
MID=(FIRST+LAST)/2;
KALLADI HSS NOTES BY MUSTHAFA 9544885401
if(ITEM == LIST[MID])
{
LOC = MID;
break;
}
if(ITEM < AR[MID])
LAST = MID-1;
else
FIRST = MID+1;
}
if(LOC != -1)
cout<<"The item is found at position "<<LOC+1;
else
cout<<"The item is not found in the array";
return 0;
}
Declaring 2D arrays
data_type array_name[rows][columns];
The rows refers to the number of rows in the array and columns refers to the number of columns in the array.
Eg: int mark [60][6]; → Array with 60 rows and 6 columns.(Array to store the marks in 6 subjects
of 60 students.)
char name[20][50]; →Array to store 20 Names in which each name can contain maximum 50
characters.
KALLADI HSS NOTES BY MUSTHAFA 9544885401
Accessing elements of 2D Array
0 1 2 3
For Eg:
=4 x 5 x4 =80 Bytes.
Matrices as 2D arrays
Matrix is a two dimensional array with m rows and n columns.To represent a matrix using program , we use
nested loop. One loop to represent rows and other to represent columns.
Reading a matrix
cin>>m>>n;
cin>>matrix[i][j];
Printing a matrix
cout<<matrix[i][j];
Transpose of a Matrix
Each matrix has a transpose. It is obtained by converting row elements into column elements or vice versa.
Multi-dimensional arrays
Each element of a 2D array may be another array. Such an array is called 3D (Three Dimensional) array. Its
declaration is as follows:
data_type array_name[size_1][size_2][size_3];
Name
s a c h I n \0
0 1 2 3 4 5 6 7 8 9
• Consider the following program to input a string and display the string
gets() function
The function gets() is a console input function used to accept a string of characters including white spaces from the standard
input device (keyboard) and store it in a character array. When using gets() function, we have to include <cstdio> header file
into our program.
Eg: gets(Name);
#include <cstdio> {
{ case 'i':
return 0;
}
KALLADI HSS NOTES BY MUSTHAFA 9544885401
puts( ) function
puts() function is a console output function used to display a string data on the standard output device -monitor. puts() will
print a ‘\n’ after the string. Its syntax is:
puts(string_data);
• getchar( )
• putchar( )
1. getchar()
getchar( ) function returns the character that is input through the keyboard. The character returned by the
getchar() function can be stored in a variable .
2. putchar()
This function displays the character given as the argument on the standard output unit (monitor). The argument
may be a character constant or a variable. If an integer value is given as the argument, it will be considered as an
ASCII value and the corresponding character will be displayed.
putchar(97); //displays 'a' on the screen (97 is the ASCII value of ‘a’).
Input functions
1. get( )
• get( ) function can accept a single character or multiple characters (string) through the keyboard.
• To accept a string, an array name and size are to be given as arguments.
Eg: char ch, str[10];
2. getline()
• getline() function accepts a string through the keyboard.
• The delimiter will be Enter key, the number of characters or a specified character.
Eg : char ch, str[10];
int len;
Output Functions
Output functions allows a stream of bytes to flow from memory into monitor.
1. put( )
put( ) function is used to display a character constant or the content of a character variable given as argument.
char ch='c';
KALLADI HSS NOTES BY MUSTHAFA 9544885401
cout.put(ch); //character 'c' is displayed.
2. write( )
char str[10]="hello";
char name[20];
cin>>name;
cout<<name;
What will be the output if you input the string “virat kohli”. ? Justify your answer? Modify the code to get the
entered string as output.?
Ans: The output will be “Virat”. cin statement can read till a white space.
char name[20];
gets(name);
puts(name);
Functions
Modular Programming
The process of breaking large programs into smaller sub programs is called modularization. These sub programs
are generally called Functions.
• Reduces the size of the program: The repeating set of instructions in a program are grouped and a
name is assigned to this group. These repeating instructions can be involked by using that name. Thus
program size is reduced.
• Less chance for Errors: When the size of the program get reduced , the number of errors will also get
reduced.
• Reduces Programming Complexity: Since the size of the program and number of errors in program are
reduced , The complexity of the program will also get reduced.
Modularization reduces programming complexity by bringing down focus to a simplified task at a time.
• Improves Reusability: A function written once can be used later in many other programs.
Proper breaking down a large program into sub programs is a challenging task , since each program must be
independent of each other.
Functions
Function is a group of statements that together performs a specific task. Most of the functions give results after
performing the task. This result is known as value returned by the function.
Parameters or Arguments:- Values that are passed to the function to perform the task assigned to it are called
Parameters or Arguments . Arguments are provided within brackets along with the function name, during function
call.
String Functions
• Several string functions are available in C++ for the manipulation of strings.
• String functions are available with the header file <cstring>.
• Different string functions in c++ are: 1.strlen( ) 2.strcpy( ) 3.strcat( ) 4.strcmp( ) 5.strcmpi( )
1. strlen( )
strlen( ) function is used to find the length of a string given as argument. Length of a string means the number of
characters in the string. Its syntax is:
This function takes a string as the argument and gives the length of the string as the result.
int n;
n = strlen(str);
Eg: n= strlen(“computer”);
cout<<n; // Prints 8.
2. strcpy( )
strcpy( ) function is used to copy one string into another. The syntax of the function is:
3. strcat( )
strcat(str1,str2);
4. strcmp( )
strcmp( ) function is used to compare two strings. In this comparison, the alphabetical order of characters in the
strings is considered.
strcmp(string1, string2)
The function returns any of the following values in three different situations.
int x,y;
x = strcmp(str1,str2);
cout<<x ; // prints 0.
y = strcmp( str2,str3);
5. strcmpi( )
strcmpi( ) function is used to compare two strings ignoring cases. That is, the function will treat both the upper
case and lower case letters as the same for comparison. Thes syntax and results are same as strcmp() function.
x = strcmp(str1,str2);
cout<<x ; // prints 0.
abs( ) function is used to find the absolute value of an integer. It takes an integer as the argument (+ve or –ve)
and returns its absolute value. Its syntax is:
int abs(int)
2. fabs( )
fabs( ) is used to find the absolute value of a floating point number . It takes a floating point number as the
argument and returns its absolute value. Its syntax is:
float fabs(float)
3. sqrt ( )
sqrt( ) function returns the square root of the integer or floating point number given as argument.
Eg: x= sqrt(25);
cout<<x; // prints 5.
4. pow()
pow( ) function is used to find the power of a number. It takes two arguments x and y and returns the value of xy.
Its syntax is:
Eg: int x = 2, y = 4, z;
5. sin( )
KALLADI HSS NOTES BY MUSTHAFA 9544885401
sin( ) is a trigonometric function and it finds the sine value of an angle.The angle must be given in radian measure.
Its syntax is:
double sin(double)
The sine value of 30° (angle 30 degree) can be found out by the following code.
6. cos()
The function is used to find the cosine value of an angle. In this case also, the angle must be given in radian
measure. The syntax is:
double cos(double)
The cosine value of 30° (angle 30 degree) can be found out by the following code.
double x = cos(30*3.14/180);
Character Functions
isupper( ) function is used to check whether a character is in the upper case or not. The syntax of the function is:
int isupper(char c)
The function returns 1 if the given character is in the uppercase, and 0 otherwise.
2. islower( )
islower( ) function is used to check whether a character is in the lower case or not. The syntax of the function is:
int islower(char c)
The function returns 1 if the given character is in the lowercase, and 0 otherwise.
3. isalpha( )
isalpha( ) function is used to check whether the given character is an alphabet or not. The syntax of the function
is: int isalpha(char c)
char c=’4’;
4. isdigit( )
isdigit( ) function is used to check whether the given character is a digit or not. The syntax of the function is:
int isdigit(char c)
char c=’m’;
5. isalnum( )
isalnum( ) function is used to check whether a character is an alphanumeric or not. The syntax of the function is:
The function returns 1 if the given character is an alphet or number , and 0 otherwise.
6. toupper( )
char toupper(char c)
The function returns the upper case of the given character. If the given character is in the upper case, the output
will be the same.
cout<<c; // Prints A.
7. tolower( )
tolower( ) function is used to convert the given character into its lower case. The syntax of the function is:
char tolower(char c)
The function returns the lower case of the given character. If the given character is in the lower case, the output
will be the same.
cout<<c; // Prints a
Conversion Functions
• Conversion functions are used to convert a string to integer and an integer to string.
• Conversion functions are available with the header file <cstdlib>.
• Conversion functions are :
1. itoa( )
2. atoi( )
1. itoa( )
This function is used to convert an integer value to string type. The syntax of the function is:
char c[10];
itoa(n, c, 10); //stores 2345 in the character array ‘c’ , of size 10.
2. atoi( )
This function is used to convert a string value to integer. The syntax of the function is:
The function takes a string as argument returns the integer value of the string
Eg: int n;
If the string consists of characters other than digits, the output will be 0. But if the string begins with digits, only
that part will be converted into integer.
• I/O Manipulating Functions are used to manipulate the input and output operations in c++.
• I/O Manipulating functions are available with the header file <cstdlib>.
• I/O Manipulating function is setw( )
setw( )
setw( ) function is used to set the width for the subsequent string.
User-defined Functions
C++ provides the facility to create our own functions some specific tasks . These functions are known as user
defined functions.
{
Function
statements in the body; Function Body Definition
int c;
c= a+b;
return c;
Prototype of functions
• A function prototype is the declaration of a function by which compiler is provided with the information
about the function such as the name of the function, its return type, the number and type of arguments etc..
data_type function_name(argument_list);
Values that are passed to the function to perform the task assigned to it are called Parameters or Arguments.
They are the means to pass values from the calling function to the called function
• Actual Arguments / Original Arguments: The constants, variables or expressions used in the
function call are known as actual (original) arguments
• Formal Arguments: The variables used in the function definition as arguments are known as formal
arguments.
Default Arguments
• In this method, the value contained in the actual argument is passed to the formal argument.
• Here a copy of the actual argument is passed to the function.
• If the formal argument is modified within the function, the change is not reflected in the actual argument
at the calling place.
• Exclusive memory allocation for actual arguments and formal arguments.
• Eg: void change(int n) // n gets the value of x, 20
{s
n = n + 1;
cout << "n = " << n ; //Prints n=21
}
int main()
{
int x = 20;
change(x); // the value of x will be passed to n.(ie, 20)
cout << "x = " << x; // prints x=20.
}
• In this method ,the reference of the actual argument is passed to the function.
• The memory location allocated to the actual argument will be shared by the formal argument.
• If the formal argument is modified within the function, the change will be reflected in the actual argument
atthe calling place.
• In C++, to pass an argument by reference we use Reference variable as formal parameter. A reference
variable is an alias name of another variable. An ampersand symbol (&) is placed in between the data type
and the variable in the function header.
• Eg: void change(int &n) // n gets the value of x, 20
{
n = n + 1;
KALLADI HSS NOTES BY MUSTHAFA 9544885401
cout << "n = " << n ; //Prints n=21
}
int main()
{
int x = 20;
change(x); // the value of x will be passed to n.(ie, 20)
cout << "x = " << x; // prints x=21.
}
Recursive function.
• Header files can be created by saving the functions(definition only) with “filename.h” format .
• User created header files can be included in a program using the following format.
#include “filename.h” (note the change – its “ and “ instead of < and >)
Eg:
int factorial(int n)
{
int f=1;
for (int i=1; i<=n; i++)
KALLADI HSS NOTES BY MUSTHAFA 9544885401
f *= i;
return f;
}
Save this in a file with the name factorial.h and then create a C++ program as follows:
#include <iostream>
#include "factorial.h" //includes user-defined headerfile
using namespace std;
int main()
{
int n;
cout<<"Enter a number : ";
cin >> n;
cout<<"Factorial : " << factorial(n);
}
2. Write a recursive C++ function that returns sum of the first n natural numbers.
3. List any three string functions in C++ and specify the value returned by them.
5. Read the function definition given below. Predict the output, if the function is called as convert(7);
void convert(int n)
if (n>1)
convert(n/2);
cout<<n%2; }
6. Explain the difference between call-by-value method and call-by-reference method with the help of
examples.
7. Arguments used in call statement are formal arguments. State true or false.
11. Explain Call by Value and Call by Reference methods of function calling with the help of
suitable examples.
12. Suggest most suitable built-in function in C++ to perform the following tasks:
13. A function can call itself for many times and return a result.
(b) Write a function definition of the above type to find the sum of natural numbers from 1 to N.
(a) The function Display() accepts one argument of type double and does not return any value.
(b) Total() accepts two arguments of type int, float respectively and return a float type value.
Computer networks
Computer network is a group of computers and other computing hardware devices connected to each other electronically
through a communication medium
1. Resource Sharing : The sharing of available hardware and software resources in a computer network is called
resource sharing. Eg: Sharing of DVD Player, Printer, Scanner ,Softwares etc.
2. Price- Performance ratio:The cost of resources can be reduced by purchasing the network versions , which can
guarantee the same performance.
3. Communication :Computer network helps to communicate with each other instantly through its services like e-
mail,chat ,video conference etc.
4. Reliability :Computer Network can store the same data in multiple computers within the network. The data lost
from one computer can be retrieved from other computers within the network.
5. Scalability : The computing capacity and storage capacity can be increased or decreased by adding or removing
devices to the system.
Terms in Network
• Bandwidth :Bandwidth is the maximum data-transfer rate in a given amount of time between computers in a
network. Bandwidth is measured in bits per second (bps).
• Noise :The unwanted electrical or electromagnetic energy that lowers the quality of data signals are called Noise.
• Node :Any device connected to a network are called Node.
The exchange of digital data between any two devices through a medium is known as Data Communication .
• Message : It is the information to be communicated such as text, image, audio, video etc.
• Sender : The device that is used for sending message is called Sender or Source or Transmitter.
• Receiver : The computer or device that receives the messages is called the receiver.
• Medium : It is the physical path through which a message travels from the sender to the receiver.
• Protocol : it is the rules under which message transmission takes place between the sender and the receiver.
Communication medium
The medium for data transmission over a computer network is called communication channel or communication medium.
The communication medium are of two types:
Guided medium or wired medium uses physical wires or cables for data tramnsmission.The different types of cables used
for networking are:
Electromagnetic waves are used for wireless communication on computer networks. Based on their frequencies ,
electromagnetic waves are categorized into:
• Radio waves.
• Micro waves.
• Infrared Waves.
1. Radio waves.
• Radio waves have a frequency range of 3 KHz to 3 GHz.
• Radio waves can be used for short and long distance communication.
• These waves can penetrate solid objects.
• They are used in Cordless phones, AM and FM radio broadcast and mobile phones…
• Radio Waves can be transmitted in all directions.
• Relatively inexpensive than wired media.
• Transmission can be affected by motors or other electrical equipment(Not Secure).
• Legal permission is needed.
2. Micro waves
• Microwave have a frequency range of 300 MHz to 300 GHz.
• Microwaves travel in straight lines and cannot penetrate solid objects.
• Transmitting and receiving antennas need to be in a straight line.’
• Relatively inexpensive than wired media.
• Offers ease of communication over difficult terrain.
3. Infrared waves
• Infrared waves have a frequency range of 300 GHz to 400 THz.
• These waves are used for short range communication (approx. 5 m).
• Used in monitoring and control applications.
• A line of sight transmission is needed(Secure).
KALLADI HSS NOTES BY MUSTHAFA 9544885401
• Only two devices can communicate at a time.
• The waves cannot cross solid objects.
1. Bluetooth.
• Bluetooth technology uses radio waves in the frequency range of 2.402 GHz to 2.480 GHz.
• This technology is used for short range communication (approx. 10 m) .
• Used in Cell phones, laptops, mouse, keyboard, tablets, headsets, cameras, etc..
• Line of sight between communicating devices is not required.
• Bluetooth can connect upto eight devices simultaneously.
• Slow data transfer rate (upto 1 Mbps).
2. WiFi
• Wi-Fi network makes use of radio wave in the frequency range of 2.4 GHz to 5 GHz.
• The wireless adapter in a computer translates data into radio signal and transmits it using an antenna. A
wireless router receives the signal ,decodes it and send it.
• Wifi technology is widely used to share Internet connection.
• Line of sight between communicating devices is not required.
• Data transmission speed is upto 54 Mbps.
• Wi-Fi can connect more number of devices simultaneously.
• Used for communication upto 375 ft (114 m).
3. WiMAX
• Worldwide Interoperability for Microwave Access (Wi-MAX) has a frequency range of 2 GHz to 11 GHz.
• Wi-MAX can provide high-speed wireless Internet access over very long distances(45 km).
• Wi-MAX equipment exists in two basic forms - base stations, installed by service providers , and receivers,
installed by clients.
• Hundreds of users can connect to a single station.
• Provides higher speed connection upto 70 Mbps.
• Line of sight between communicating devices is not required.
• Weather conditions like rain, storm, etc. could interrupt the signal.
• Very high power consumption and high costs of installation.
4. Satellite Link
• Used for long distance wireless communication.
• Signal travels in a straight line and is not able to bend around the globe.
• Signals is sent to satellites and then redirected to another satellite or directly to a far away destination.
• Transmission of signals from the earth to a satellite is called uplink.
• Transmission of signals from satellite to the earth is called downlink.
• This system is expensive.
• Requires legal permission and authorization.
A data communication device provides an interface between computer and the communication channel. Data
Communication devices are NIC , Hub , Switch , Bridge , Router , Gateway ….
2. Hub
• A hub is a device used to connect several computers of the same network .
• It is a small, simple, passive and inexpensive device
• When NIC of one computer sends data packets to hub, the hub transmits the packet to all other computers
connected to it.
• The intended computer accept it and others will discard.
• It increases the network traffic and reduces the effective bandwidth.
3. Switch
• A switch is an intelligent device that can connects several computers.
• It looks exactly like a hub.
• Switches are capable of determining the destination and redirect the data only to the intended node.
• Switch performs this by storing the addresses of all the devices connected to it using a table.
4. Repeater
• Repeater is a device that receives incoming data signals, amplifies the signals to their original
strength and retransmits them to the destination.
5. Bridge
• A bridge is a device used to segmentize a network.
• An existing network can be split into different segments and can be interconnected using a bridge.
• This reduces the amount of traffic on a network.
• When a data packet reaches the bridge, Only those packets addressed to other side, will be allowed to pass
the bridge. Others will be discarded. The packet that passes the bridge will be broadcast to all nodes on the
other side.
6. Router
• A router is a device that can interconnect two networks of the same type using the same protocol
• It can find the optimal path for data packets to travel and reduce the amount of traffic on network.
• The router check the device address and the network address ,and use algorithms to find the best path for
packets to reach the destination.
7. Gateway
• A gateway is a device that can interconnect two different networks having different protocols.
• It can translate one protocol to another protocol.
• It is a network point that acts as an entrance to another network
A data terminal equipment (DTE) is a device that controls data flowing to and from a computer. Most commonly used DTEs
are Modem and Multiplexer.
1. Modem
• A modem is an electronic device used for communication between computers through telephone lines.
• It converts digital signals received from a computer to analog signals (modulation) for telephone lines.
• It also converts the analog signals received back from telephone lines to digital signals (demodulation).
• The speed of modem is measured in bits per second (bps).
2. Multiplexer/Demultiplexer
• Multiplexing is sending multiple signals on a physical medium at the same time in the form of a single signal and
then recovering the separate signals at the receiving end.
• Multiplexer is a device that combines (multiplexes) the inputs from different sources and sends them through
different channels of a medium.
• At the destination, a demultiplexer separates (demultiplexes) the signals.
Network Topologies
The way in which the nodes are physically interconnected to form a network is called a Topology. Major topologies are bus,
star, ring and mesh.
1. Bus topology
• In bus topology all the nodes are connected to a main cable called bus.
• If a node has to send data to another node, it sends data to the bus. The signal travels through the bus. All nodes
check the bus, and only the node for which data is addressed accepts it.
• A small device called terminator is attached at each end of the bus. When the signal reaches the end of the bus, the
terminator removes the signal.
• Easy to install.
• Requires less cable length
• It is cost effective.
• Failure of a node does not affect the network
• Failure of cable (bus) or terminator leads to a break down of the entire network.
• Fault diagnosis is difficult.
• Only one node can transmit data at a time.
2. Star Topology
• In star topology each node is directly connected to a hub/switch.
• If any node has to send some information to any other node, it sends the signal to the hub/switch. This signal is
then broadcasted (in case of a hub) to all the nodes but is accepted only by the intended node. In the case of a
switch, the signal is sent only to the intended node.
• More efficient compared to bus topology.
• Easy to install.
• Easy to diagnose faults.
• Easy to expand depend.
• Failure of hub/switch leads to failure of entire network.
KALLADI HSS NOTES BY MUSTHAFA 9544885401
• Requires more cable length compared to bus topology.
3. Ring topology
• In ring topology, all nodes are connected using a cable in the form of ring or circle. A ring topology has no start and
no end.
• Data travels only in one direction in ring.
• While they are passed from one node to the next, each node regenerates the signal.
• The node for which the signal is intended reads the signal. After travelling through each node, the signal reaches
back to the sending node from where it is removed.
• Requires less cable length and hence is cost effective.
• If one node fails, entire network will fail.
• Addition of nodes to the network is difficult.
4. Mesh topology
• In mesh topology, every node is connected to other nodes. So there will be more than one path between two
nodes .
• If one path fails, the data will take another path and reach the destination.
• Network will not fail even if one path between the nodes fails.
• Expensive because of the extra cables needed.
• Very complex and difficult to manage.
Types of networks
On the basis of the area covered, computer networks are classified as:
• PAN - Personal Area Network
• LAN - Local Area Network
• MAN - Metropolitan Area Network
• WAN -Wide Area Network
Client-Server
• The client-server architecture consists of high configured computer (called server) serving lower configuration
machines called clients. A server provides clients with specific services when client requests.
• Client-server architecture is an example for centralized software management. When software is loaded on
the server and shared among the clients, changes made to the software in the server will reflect in the clients
also.
Network protocols
A network protocol is the set of rules to be followed in a network when devices in the network exchange data with
each other. Some commonly used protocols are TCP/IP, SPx/IPx, BGP etc.
TCP/IP
• TCP/IP, Transmission Control Protocol/Internet Protocol, is a container of communications protocols used to
interconnect network devices on the local networks and the Internet.
• TCP/IP defines rules for how electronic devices should be connected to the Internet and how data should be
transmitted between them.
Working of TCP/IP:
Step 1: TCP at the sender breaks the data into packets along with the address of the receipient and send the data.
Step 2: Routers Transport and route the data to their destination according to IP.
Step 3: TCP at the receiver’s side reassembles the packets to form original data
HTTP
• HTTP stands for Hypertext Transfer Protocol. It is a standard protocol for transferring requests from client-side and
to receive responses from the server side.
• The HTTP client (browser) sends a HTTP request to the HTTP server (web server) and server responds with a HTTP
response. This pair of request and response is called an HTTP session
FTP
FTP ( File Transfer Protocol ) is a protocol for exchanging of data and program files across a network. FTP is the easiest
way to transfer files between computers via the Internet. FTP client softwares are Filezilla, Cute FTP,etc.
DNS
DNS stands for Domain Name System. DNS returns the IP address of the requested domain Name. DNS implements a
database to store domain names and IP address of all web sites on the Internet.
a) Protocol
It specifies what protocol is used to access the information specified in the domain.
b) Domain name
Domain name is the name assigned to a server through the Domain Name System (DNS). Domain names are used
in URLs to identify the particular web server.
A domain name usually has more than one part: Top level domain name or primary domain name and sub-
domain name(s).
There are only a limited number of top level domains and these are divided into two categories: Generic Domain
Names and Country-Specific
c) File name
It specifies the file to be opened. In the above example 'index.html' is the file that is to be accessed from the web
server specified by the domain name.
Previous Questions
1. Identify the name given to the physical arrangement of computers in a network? Explain two types with block
diagrams. (March 2015) Score 3
2. Write any two advantages of Network. (March 2015) Score 2
3. What are the advantages of Wi-Fi network? (March 2015) Score 2
4. In communication system the term source refers to …….. … (SAY 2016 June) Score 1
5. Explain the following terms in computer networking a). Node b). Bandwidth c). Noise (SAY 2016 June) Score 3
6. Match the following
A B
Unguided Media org
Generic Domain Name Coaxial cable
Guided Media microwave
Protocol http (March 2016) Score 2
7. Compare ring topology and mesh topology (March 2016) Score 3
8. "Client-server architecture is an example of centralized software management." Justify. (March 2016) Score 2
9. If all devices are connected to a central switch/hub, the topology is known as……..(SAY 2016 June) Score 1
10. List any four advantages of forming computer networks. (SAY 2016 June) Score 2
11. A device that regenarate the incomimg signal and retransmit them to their destination is called …….. (Imp 2015 )
12. Which of the following communication technology is the slowest a) Bluetooth b) Wi-Fi c) Wi Max d)Satelite Link
(Imp 2015 ) Score 1
KALLADI HSS NOTES BY MUSTHAFA 9544885401
13. Consider your teacher planning to connect the computers in the computer lab of your school to form a network. a).
He has a switch and a hub to connect these computers. Which will you prefer? Why? (Imp 2015 ) Score 2
b). Name the topology you will suggest for this network. Give reason for your suggestion. (Imp 2015 ) Score 3
14. Internet is an example of _____. a) MAN b) PAN c) WAN d) LAN (1) (July 2017)
15. Explain the advantages of forming networked computers than keeping them standalone computers. (3)
16. a) Different networks with different protocols are connected by a device called …………
(i) Router (ii) Bridge (iii) Switch (iv) Gateway (1) (March 2017) b) Define protocol. (1) (March 2017)
17. Compare any three types of networkbased on span of geographical area. (3) (March 2017)
18. Write notes on the following: a) IP address b) MAC address c) Modem (3) (Sept. 2016) 7. Define network topology.
Explain any four network topologies in detail. (3) (Sept. 2016)
19. Identify the type of LAN topology in which there are more than one path between nodes. (a) Star (b) Ring (c) Mesh
(d) Bus (1) (March 2016)
20. Any device which is directly connected to a network is generally known as _____. (1) (March 2015)
▪ ARPANET-(Advanced Research Project Agency Network.) was a Project by American Defence Department,
which is considered as the first Wide Area Network that used TCP/IP protocol for communication.
▪ ARPANET combined many other network to form a WAN, which becomes the Internet.
▪ TIM BERNERS LEE is considered as Founder of WWW , Founder of HTTP, founder of Web server and Web
browser technology and Founder of HTML.
Internet
Intranet
▪ Intranet is a private network within an organization , that uses TCP/IP protocol for communication.
Extranet
▪ The Intranet that is accessible to some computers that IS not part of a company’s private network is called
Extranet.
▪ Dial-Up Connectivity.
▪ Wired Broadband.
*ISDN * Cable Internet
* DSL * Leased Line * FTTH
▪ Wireless Broadband Connectivity
*Mobile Broadband *WiMax
*Satellite broadband.
➢ Dial-Up Connectivity
▪ Uses Telephone line and Dialup modem to dial and connect to the server at the ISP.
▪ Connecting time is high.
▪ Uses 56kbps DialUp Modem
▪ Slow connection, speed upto 56 kbps.
▪ At a time Data or voice call is possible.
➢ Wired Broadband Connectivity
▪ Always-on Connection.
▪ Uses Broadband Modem- allows to use telephone and Internet(call and data at the same time)
▪ High speed conncetion (256 kb -100 Mb)
▪ Popular broadband technologies are:
*ISDN
*Cable Internet
*DSL
*FTTH
*Leased Line
Dial-Up Connection Wired broadband Connection
• Slow connection, speed upto • High speed connection,speed higher
56kbps than 256kbps.
• Always on connection.
• Requires dialing to connect to ISP • Simultaneous use of voice and
• Use telephone line exclusively. Internet.
• Use dial up modem. • Used broadband modem.
Leased Line
• It provide dedicated lines to provide Internet to ISPs,large organizations etc.
• It can provide data transfer rate upto 100 mbps.
• It is very expensive
FTTH-Fibre To The Home.
• It Uses optical fibre cable for data transmission.
• Provides high speed internet connection.
• It needs a NTU-Network Termination Unit which is to be connected to FTTH Modem that is
connected to the Computer.
• It can provide high speed internection to homes/institutions/organizations etc..
Wi-Max
• WiMax can provide internet connectivity to a distance around 50 Kms with a speed upto
70Mbps.
• Connectivity is provided using the devices like WiMax handsets,USB dongles etc.. that have
WiMAX modem.
▪ Using LAN
Internet connected to a computer in Local Area Network(LAN) can be shared among other computers in
the network .This can be done using Proxy server or Router.
Provide Internet connectivity through a wifi router or a network access point called hotspot.Wifi is a short
distance data transmission technology .
It uses visible light for data transmission.The main component is a LED that can transmit data and a photo
diode as the receiver. A data rate of 100mbps is possible Using LiFi technique.
▪ WWW is a system of interlinked hypertext documents that can be accessed via Internet.
▪ It is a Client-Server System where Server contains a collection of documents which can be accessed using
URL.
→Web Browser
• It is a Software used to Retrieve/ Present Information to and from web pages in the www.
• It can display images ,videos,audios, hyperlinks etc.
KALLADI HSS NOTES BY MUSTHAFA 9544885401
• It allows user to navigate through web pages of www.
• Eg: Mozilla Firefox ,Google Chrome ,Opera ,Safari ,Internet Explorer….
→Web Browsing
Traversing through the web pages of World wide web is called Web Browsing.
▪ Step 2 :DNS server returns the IP corresponding to the requested Domain name.
▪ Step 4:Browser connects to the server and request a web page (HTTP Request)
▪ Step 6: Web server returns the requested web page in HTML format.
▪ Step 7:Browser Format and displays the web page to the user.
1. Search Engines
▪ A web search engine is a software system that is designed to search for information on the World Wide
Web.
▪ They search web pages for the given keyword and return a list of URL of web pages matching the keyword.
▪ Web Crawlers or Spiders are Programs search web pages and find possible keywords.
▪ Working
1. Web crawler contineosly searches through the web and collect possible keywords to build a search
index.
2. When user searches a keyword, Search engine searches in the Search index are returs the list of URLs
that contains the keyword.
▪ E-mail is the exchange of digital message between computers over the Internet.
▪ We can also include images ,videos , audio, documents etc in our mail along with texts.
Sections of an e-mail
Working of e-Mail
1. Sender composes the message using email client and Uploads to the SMTP server.
2. Message travels through the internet.
3. Recipients email client checks for new messages and download new message.
4. Message is placed at the recipient’s inbox.
5. Recipient opens and reads the message using email client.
Advantages of email
DisAdvantages of e-mail
4. Social Media
Social media refers to the use of mobiles and web based technologies through which individuals can
create,share ,discuss and modify contents.
1. Internet Forums
An Internet forum is an online discussion web site where people can engage in conversations in the form of
posted messages
Eg for internet forums : Ubuntu forum , Mi Forum etc.
2. Social blogs
A blog (web log) is a discussion or informational website consisting of entries or posts displayed in the
reverse chronological order.
Eg: Blogger.com ,Wordpress.com .
3. Microblogs
Microblogs allow users to exchange short sentences, images or video links. People use microblogs to share
what they observe in their surroundings.
Eg: Twitter.com
4. Wikis
Wikis allow people to add content or edit existing information in a web page, to form a community
document.
Eg : wikipedia.org
5. Social networks
Social networking sites allow people to build personal web pages and then connect with friends to
communicate and share content. We can share text, pictures, videos, etc. and comment to the posts.
Eg : Facebook.com , LinkedIn , Instagram
6. Content communities
Content communities are websites that organise and share contents like photos,videos, etc.
Eg : Youtube.com ,Flickr.com
1. Intrusion to privacy:
2. Addiction
3. Spread rumours
Cyber Security
Cyber security refers to the security of computer systems and computer networks against cyber attacks.
Cyber Attacks
1. Computer virus
• A computer virus is a program that attaches itself to another program or file.
• Virus can spread from one computer to another without our knowledge and interferes the normal
operation of a computer.
• A virus might corrupt or delete data on our computer, replicate itself and spread to other computers.
2. Worm
• A computer worm is a stand alone malicious software that can replicate itself and spread to other
computers.
• Worms can spread from one computer to canother on its own.
• A worm can send a copy of itself to every address in an e-mail address book.
• Worms mainly do attack on Networks.
3. Trojan horse
• A Trojan horse is a program that appear to be a useful software and do damage once run on the
computer.
• Trojans cannot reproduce by itself.
• When a Trojan is activated on a computer, they can cause serious damage to our computer system.
4. Spam
6. Phishing
• Phishing is an attempt to acquire information such as usernames, passwords and credit card details
by posing as the original website.
• Phishing websites have URLs and home pages similar to their original ones.
• The act of creating such a misleading website is called spoofing
7. A Denial of Service(DoS)
• It is an attack on web server whose intension is to deny the service Provided by the Server to the
users.
• The attackers’ goal is to shut down the target server rather than stealing data.
• DoS and DDoS.
• The Hacked computers that are used for DoS attack are called Zoombies.
8. Man-in-the-Middle attacks
• It refers to the attack in which Attacker capture and modifies the transmitting messages between
the sender and receiver.
• To prevent this type of attack use encrypted connections such as HTTPS , SFTP etc..
Firewall
▪ Antivirus tools are the programs that are used to detect and remove malware programs.(Virus , Worm ,
Trojan).
▪ Anti-virus software scans files in the computer system for known viruses and removes them if found.
▪ Quarantine is a special area for storing files probably infected with viruses.(Sandboxing).
Cookies
▪ Cookies are small text files that are created within the browser when we visit a website.
▪ Cookies keep track of our movements within the website – remembers our user name, preferences, e-
mail address, etc.
▪ Websites use cookies mainly because they save time and make browsing efficient.
Internet of Things
▪ It includes automatic Call to Super Market when need some things , Call a Doctor when needs etc...
Mobile Computing
KALLADI HSS NOTES BY MUSTHAFA 9544885401
▪ Mobile computing is a technology that has computing capability and can transmit/receive data from
where ever they are.
▪ It Requires
3. Connectivity to Internet.
Mobile Communication
▪ Mobile communication devices does not require any physical connection for communication.
▪ 2G Networks Follow Digital system for communication and improved audio quality in transmission.
▪ Uses Narrowband TDMA(Time Division Multiple Acces), provides simultaneous call on same radio
frequency.
▪ Expanded with improved performance with data communication using GPRS(General Packet Radio Service)
and EDGE(Enhanced Data Rate for GSM Evolution ).
▪ 4G is also called L.T.E(Long Term Evolution ),Provides ultra broadband internet to mobiles.
▪ 4G Offers high speed internet and high quality video streaming applications
▪ Smart Cards
• A mobile operating System is the Operating system used in mobile devices such as smart phones , tablets
etc.
• A mobile Operating System manages the hardware , multimedia functions ,Internet connectivity etc in a
mobile device.
Eg:-
• Android From Google
• iOS From Apple
• BlackBerry OS from BlackBerry
• Windows Phone from Microsoft
▪ Android is a Linux based Operating system designed for touch screen mobile devices.
▪ Android was developed by Andy Rubin and later Google acquired Android.
▪ User interface of Android is based on touch inputs like swiping, tapping ,pinching etc.
▪ Android allows users to customize their home screen with shortcuts to applications and widgets.
Android Versions
KALLADI HSS NOTES BY MUSTHAFA 9544885401
Version Name Version Name
1.5 Cupcake 4.4 Kitkat
1.6 Donut 5.0 Lollipop
2.0 Éclair 6.0 Marshmallow
2.2 Froyo 7.0 Nougat
2.3 Gingerbread 8.0 Oreo
3.0 Honeycomb 9 Pie
4.0 Ice cream Sandwitch 10 Android 10
4.1 Jelly Bean 11,12,13,14…..