Computer Full Notes Completed 10 Classs
Computer Full Notes Completed 10 Classs
Chapter#1
1. Define computer.
Called computer.
OR
Algorithm
OR
Role of Algorithm
1
Islamabad Career Schools- Network Computer Notes - X
2
Islamabad Career Schools- Network Computer Notes - X
3
Islamabad Career Schools- Network Computer Notes - X
3. What is Flowchart?
OR
4
Islamabad Career Schools- Network Computer Notes - X
5
Islamabad Career Schools- Network Computer Notes - X
Extensive Questions:
Step 1: Start
Step 5: End
Step 1: Start
OR
Step 3: L cm=Li*2.54
Step 4: print L cm
Step 5: End
6
Islamabad Career Schools- Network Computer Notes - X
3. Write an algorithm that inputs marks and prints massage pass or fail.
passing marks are 33.
Step 1: Start
Step 5: End
Sum=20+25+30+35+40+45+50+55+60
Step 1: Start
Step 2: Sum=0,K=5
Step 3: Sum=Sum +k
Step 4: K=k=5
Step 7: End
Product= 1*3*5*7*9*11*13*15
Step 1: Start
7
Islamabad Career Schools- Network Computer Notes - X
Step 3: K=k+2
Step 4: Prod=Prod*k
Step 7: End
Step1: Start
Step 3: I=10
Step 4: Prod=N*1
Step 6: I=i-1
Step 7: If the value of I is >0 Then Goto step 4 otherwise Goto step 8
Step 8: End
8
Islamabad Career Schools- Network Computer Notes - X
FLOWCHARTS
start
INPUT L, B
AREA=L*B
PRINT AREA
END
FLOWCHARTS NO 5
start
INPUT LENGTH LI
LCM=LI*2.54
PRINT LCM
END
9
Islamabad Career Schools- Network Computer Notes - X
FLOWCHARTS NO 6
START
INPUT MARKS(M)
YES
IF M<33
NO
FAIL
PASS
STOP
10
Islamabad Career Schools- Network Computer Notes - X
FLOWCHARTS NO 7
START
SUM=0,K=5
SUM=SUM+K
K =K+5
YES
NO
IF K<60
PRINT SUM
END
11
Islamabad Career Schools- Network Computer Notes - X
FLOWCHARTS NO 8
START
K=1,PROD=1
K=K+2
PROD=PROD*K
NO YES
IF K<16
PRINT PROD
END
12
Islamabad Career Schools- Network Computer Notes - X
FLOWCHARTS NO 9
START
ENTER NUMBER N
I=10
PROD=N*1
PRINT N,I,PROD
I=I-1
YES NO
IF I>0
END
CHAPTER 2
13
Islamabad Career Schools- Network Computer Notes - X
14
Islamabad Career Schools- Network Computer Notes - X
15
Islamabad Career Schools- Network Computer Notes - X
5. Define IDE.
16
Islamabad Career Schools- Network Computer Notes - X
CONSTANT VARIABLE
17
Islamabad Career Schools- Network Computer Notes - X
Not Valid
9.What are reserved words? why they should not be used as variable
names?
The words that are part of programming language and have special
purposes in computer programs are called reserved words or keywords.
18
Islamabad Career Schools- Network Computer Notes - X
Example
A variable of type int can act as a variable of type char using
typecasting. This is required in some situations in programming in c
language
Compiler Interpreter
A compiler is a program that An interpreter is a program that translates high
translates source program into level language programs into machine language
object program. but one line at a time.
It translates whole program. It translates one line at a time.
Example C, pascal, java etc Example Basic, VB,Perl etc
12. Difference b/w Assembler and Interpreter
Source program Compiler Object program
19
Islamabad Career Schools- Network Computer Notes - X
C # Features
Simple
20
Islamabad Career Schools- Network Computer Notes - X
CHAPTER 3:
21
Islamabad Career Schools- Network Computer Notes - X
%d decimal integer
%i integer
%ld long decimal integer
%f floating point(decimal notation)
%g floating point(exponential(notation)
%e floating point (%f or %g,whichever is shorter)
%c single character
%s string
Example
# include<stdio.h>
Void main(void)
22
Islamabad Career Schools- Network Computer Notes - X
Getch();
Output of a program
The gets() function is used to read a string from the keyboard and store
it in the variable specified inside the parenthesis.
Example
#include<stdio.h>
Void main(void)
23
Islamabad Career Schools- Network Computer Notes - X
Gets(name);
getch() ;
Output of a program
Example
#include<stdio.h>
24
Islamabad Career Schools- Network Computer Notes - X
#include<conio.h>
Void main(void)
Char ch;
Ch=getche();
Getch();
Output of a program
25
Islamabad Career Schools- Network Computer Notes - X
a) 7+5*(3+4)
Solution
7+5*(3+4)
=7+5*7
=7+35
=42
b) 100/10/4
Solution
100/10/4
=10/4
=2.5
c) 50%13%3
Solution
50%13%3
=11%3
=2
26
Islamabad Career Schools- Network Computer Notes - X
d) 30/7*3-6
solution
30/7*3-6
=4.28*3-6
=12.8-6
=6.8
Output
Z1=3
Z2=2
Z3=18
Z4=5
Output
C=7.840000
D=2.120000
E=6.160000
F=10.920000
27
Islamabad Career Schools- Network Computer Notes - X
Exercise programs.
Question 1.
#include<stdio.h>
Int main()
Int num1,num2,num3,sum,prod,avg;
Scanf(“%d,%d,%d”,&num1,num2,num3);
Sum=num1+num2+num3;
Prod=num1*num2*num3;
Avg=sum/3;
28
Islamabad Career Schools- Network Computer Notes - X
Question 2.
#include<stdio.h>
main()
Float length,width,area;
Scanf(“%f”,& width);
Area=length*width;
Question 3.
#include<stdio.h>
.#include<conio.h>
main()
29
Islamabad Career Schools- Network Computer Notes - X
Float side,volume
Scanf(“%f,&side);
Volume=side*side*side;
Question 4.
#include<stdio.h>
.#include<conio.h>
main()
Float fhren,Celsius;
Scanf(“f”,&Celsius);
Fahren =(9.0/5.0)*Celsius+32;
30
Islamabad Career Schools- Network Computer Notes - X
Question 5.
#include<stdio.h>
#include<string.h>
Int main()
Char name[50],add[50];
gets(name);
gets(add);
Puts(name);
Puts(add);
31
Islamabad Career Schools- Network Computer Notes - X
CHAPTER 4:
Syntax Syntax
If(condition) If(condition)
{ {
32
Islamabad Career Schools- Network Computer Notes - X
} }
Else
Block of statements
Syntax Syntax
Switch(expression) If(condition)
{ {
Case const-1: Block of statements
Statements; }
Break; Else
33
Islamabad Career Schools- Network Computer Notes - X
Case const-2: {
Statements; Block of statements
Break; }
.
.
Default:
Statements;
}
OR
The loop inside one or more loop is called nested loop.
In computer programming it is required to use a selection structure
within another selection structure. This is also supported in c language.
In c language ,the programmer can have a selection structure(If,if-else,
else if or switch statement) within another selection structure.
34
Islamabad Career Schools- Network Computer Notes - X
If(a+b)>20
K=a+3*b;
Else
K=a-b;
Z=x-5*y;
Ans
Z=(x>y)?(x+y)/3:x-5*y;
Ans
Count=10
Sum=58
35
Islamabad Career Schools- Network Computer Notes - X
Chapter 5
Exercise short questions.
The for loop is used to execute a set of The while loop is used to to execute a
statement repeatedly for a fixed set of statement or keep repetitions
number of times. continues until some condition
remains true.
In For loop the programmers known in In While loop the programmers is not
advance to how many times loops must known in advance to how many times
be repeated. loops must be repeated.
Syntax Syntax
36
Islamabad Career Schools- Network Computer Notes - X
The iterations do not occur if the The iteration occurs at least once
condition at the first iteration, even if the condition is false at
appears false. the first iteration.
Syntax Syntax
While(condition) Do
{ {
} }
While(test condition);
37
Islamabad Career Schools- Network Computer Notes - X
Ans
I am a student
I am a student
I am a student
I am a student
I am a student
GOOD BYE
Int k,a
a=3;
38
Islamabad Career Schools- Network Computer Notes - X
K=1 ;
While (k<10);
Print(“\n%f\t%f”,k,k*a-1);
K=k+2;
Ans
int a,k;
a=3;
k=1;
while(k<10)
Printf(“\n%d\t%d”,k,k*a-1);
K=k+2;
}
Output:
1 2
3 8
39
Islamabad Career Schools- Network Computer Notes - X
5 14
7 20
9 26
6.Convert following for loop into a while loop.
Int k;
For(k=25; k>0; k=k-3)
Printf(“\n%d”,k);
Ans
Int k;
k=25
while(k>0)
{
Printf(“\n%d” ,k);
K=k-3
}
40
Islamabad Career Schools- Network Computer Notes - X
CHAPTER 6
Short Questions
Logic gates operate on two voltage levels and process digital signals
which represents binary digital 0 and 1.
41
Islamabad Career Schools- Network Computer Notes - X
Example
F=x+y
For all the other combination of x and y, the function will be=1
42
Islamabad Career Schools- Network Computer Notes - X
22 =4
43
Islamabad Career Schools- Network Computer Notes - X
Use of K-Map
44
Islamabad Career Schools- Network Computer Notes - X
45
Islamabad Career Schools- Network Computer Notes - X
46
Islamabad Career Schools- Network Computer Notes - X
B B B B
A B C A B C A B C A B C
A
A B C A B C A B C
A A B C
C C C C
47
Islamabad Career Schools- Network Computer Notes - X
Long Question
AND Gate:
The logic gate AND takes two or more input and works as per the
following truth table
48
Islamabad Career Schools- Network Computer Notes - X
49
Islamabad Career Schools- Network Computer Notes - X
OR Gate:
The logic gate OR takes two or more input and works as per the
following truth table
50
Islamabad Career Schools- Network Computer Notes - X
51
Islamabad Career Schools- Network Computer Notes - X
52
Islamabad Career Schools- Network Computer Notes - X
53
Islamabad Career Schools- Network Computer Notes - X
54
Islamabad Career Schools- Network Computer Notes - X
There are three basic logic gates are used in digital circuits which are
AND,OR and NOT gates.
AND Gate:
The AND gate has two or more inputs that can be LOW(0) or HIGH(1).
the output is high only when all the inputs are high. it produces a low
output when at least one of the inputs is low
55
Islamabad Career Schools- Network Computer Notes - X
OR GATE:
NOT GATE
56
Islamabad Career Schools- Network Computer Notes - X
NAND GATE:
NOR GATE:
57
Islamabad Career Schools- Network Computer Notes - X
Explain how NAND and NOR gates can be created using AND,OR and
NOT gates.
A F=AB F=AB
58
Islamabad Career Schools- Network Computer Notes - X
F=A+B F=A+B
Soiution
1.F1=xyz+xyz+xyz
59
Islamabad Career Schools- Network Computer Notes - X
2.F2=xz+yz+xyz
x y z x y z xz yz xyz F2
1 1 1 0 0 0 0 0 1 1
1 1 0 0 0 1 0 1 0 1
1 0 1 0 1 0 0 0 0 0
1 0 0 0 1 1 0 0 0 0
0 1 1 1 0 0 1 0 0 1
0 1 0 1 0 1 0 1 0 1
0 0 1 1 1 0 1 0 0 1
3.F3=xyz+xyz+xyz+xyz
60
Islamabad Career Schools- Network Computer Notes - X
1 1 1 0 0 0 0 0 0 0 0
1 1 0 0 0 1 0 0 0 1 1
1 0 1 0 1 0 0 0 0 0 0
1 0 0 0 1 1 0 0 0 0 0
0 1 1 1 0 0 0 0 1 0 1
0 1 0 1 0 1 0 0 0 0 0
0 0 1 1 1 0 0 1 0 0 1
0 0 0 1 1 1 1 0 0 0 1
61
Islamabad Career Schools- Network Computer Notes - X
4.F4=xz+xy
X Y Z X Y Z xz xy F4
1 1 1 0 0 0 0 0 0
1 1 0 0 0 1 1 0 1
1 0 1 0 1 0 0 0 0
1 0 0 0 1 1 1 0 1
0 1 1 1 0 0 0 0 0
62
Islamabad Career Schools- Network Computer Notes - X
0 1 0 1 0 1 0 0 0
0 0 1 1 1 0 0 1 1
0 0 0 1 1 1 0 1 1
1.F1=xyz+xyz+xyz
Step#1
YZ YZ YZ YZ
63
Islamabad Career Schools- Network Computer Notes - X
Step#2
YZ YZ YZ YZ
0 0 1 1
X
X
Step# 3
Grouping 0 0 0 1
Group#1 xy z, x y z = xy
Group#2 xy z, x y z = yz
Step#4
Apply Maxterm function
Xy+yz
2.F2=xz+yz+xyz x+x=1
y+ y=1
Z+Z=1
YZ YZ YZ YZ
64
Islamabad Career Schools- Network Computer Notes - X
Step#2
YZ YZ YZ YZ
0 1 1 1
X
X
0 0 1 1
Step# 3
Grouping
Group#1 xy z, x y z = xz
Group#2 xy z, x y z = yz
Group#3 xy z, x y z = yz
Step#4
Apply Maxterm function
Xz+yz+yz
Ans Xz+y
3.F3=xyz+xyz+xyz+xyz
Step#1
65
Islamabad Career Schools- Network Computer Notes - X
YZ YZ YZ YZ
Step#2
YZ YZ YZ YZ
1 1 1 0
X
X
Step# 3
Grouping 0 0 0 1
Group#1 xy z, x y z, x y z
missing(xyz)
Group# xy , x, x z,x y z
Ans x
4.F4=xz+xy
Step#1 xz+xy
Xz(1)+(1)xy
Xz(y+ y)+x y(z+z)
Xyz+xyz+xyz+x yz
66
Islamabad Career Schools- Network Computer Notes - X
Step#1
YZ YZ YZ YZ
Xy z xyz xyz Xyz
X
xyz xyz xyz Xyz
X
Step#2
YZ YZ YZ YZ
1 1 0 0
X
X
Step# 3
Grouping
Group#1 xy 1 0 0 1 z, x y z=x y
Group#2 xy z, x y z=y z
Group#3 xy z,x y z=x z
Step#4
Apply Maxterm function
1) F1= x y z + x y z
67
Islamabad Career Schools- Network Computer Notes - X
2) F2= x + y z
3) F3= x y + x y z+ x y z
4) F4= x+y + y z
X
X XYZ
Y Y
Z
5
F1= X Y Z+ X Y Z
X
Y Y
Z
XYZ
F2= x + yz
X
X
y
F2= X + Y Z
YZ
68
Islamabad Career Schools- Network Computer Notes - X
F3= x y + x y z+ x y z
X XYZ
X
XYZ
Y F3=XY+XYZ+XYZ
Y
Z
X XY
F4= x+y+ y z
X
X+y
y
y
69
Islamabad Career Schools- Network Computer Notes - X
X+y+yz
Chapter 7:
web page
A document which can be displayed in a web browser such as
Firefox, Google Chrome, Opera, Microsoft Internet Explorer or Edge,
or Apple's Safari. These are also often called just "pages."
website
A collection of web pages which are grouped together and usually
connected together in various ways. Often called a "web site" or
simply a "site."
OR
Web server:
70
Islamabad Career Schools- Network Computer Notes - X
The web server on the other side is a computer program, which delivers
content, such as websites or web pages, for example, over the world wide
web from a web server to your computer.
search engine
A website that helps you find other web pages, such as Google, Bing,
or Yahoo.
71
Islamabad Career Schools- Network Computer Notes - X
URL
72
Islamabad Career Schools- Network Computer Notes - X
Web Hosting
OR
What is HTML?
73
Islamabad Career Schools- Network Computer Notes - X
</body>
</html>
Try it Yourself »
Follow the four steps below to create your first web page with
Notepad or Text Edit.
Step 1: Open Notepad (PC) Windows 8 or later: ...
Step 2: Write Some HTML. ...
Step 3: Save the HTML Page. ...
Step 4: View the HTML Page in Your Browser
= New in HTML5.
74
Islamabad Career Schools- Network Computer Notes - X
Basic HTML
Tag Description
75
Islamabad Career Schools- Network Computer Notes - X
Formatting
Tag Description
76
Islamabad Career Schools- Network Computer Notes - X
77
Islamabad Career Schools- Network Computer Notes - X
gauge)
78
Islamabad Career Schools- Network Computer Notes - X
Tag Description
79
Islamabad Career Schools- Network Computer Notes - X
80
Islamabad Career Schools- Network Computer Notes - X
Frames
Tag Description
Images
Tag Description
81
Islamabad Career Schools- Network Computer Notes - X
Audio / Video
Tag Description
Links
Tag Description
82
Islamabad Career Schools- Network Computer Notes - X
Lists
Tag Description
83
Islamabad Career Schools- Network Computer Notes - X
Tables
Tag Description
84
Islamabad Career Schools- Network Computer Notes - X
formatting
Tag Description
85
Islamabad Career Schools- Network Computer Notes - X
<details> Defines additional details that the user can view or hide
Meta Info
Tag Description
Programming
Tag Description
86
Islamabad Career Schools- Network Computer Notes - X
NEW
Tag Description
87
Islamabad Career Schools- Network Computer Notes - X
<basefont> Specifies a default color, size, and font for all text
in a document
88
Islamabad Career Schools- Network Computer Notes - X
89
Islamabad Career Schools- Network Computer Notes - X
translation
90
Islamabad Career Schools- Network Computer Notes - X
91
Islamabad Career Schools- Network Computer Notes - X
92
Islamabad Career Schools- Network Computer Notes - X
93
Islamabad Career Schools- Network Computer Notes - X
support frames
94
Islamabad Career Schools- Network Computer Notes - X
95
Islamabad Career Schools- Network Computer Notes - X
96
Islamabad Career Schools- Network Computer Notes - X
97
Islamabad Career Schools- Network Computer Notes - X
98
Islamabad Career Schools- Network Computer Notes - X
99
Islamabad Career Schools- Network Computer Notes - X
These instructions control the order in which other instructions are executed by
transferring the control to the instruction executed next.
Q: What is purpose of Arithmetic instructions?
A:
These instructions direct a computer for Arithmetical Computations and moving
data from one place to another in memory.
Q: What is purpose of Logical instructions?
A:
These instructions enable the compute
r to compare items of data and proceed according to the result of the comparison
whether certain condition is true or false.
Q: What is purpose of Specification instructions?
A:
These instructions are descriptive. A programmer can inform a
computer about things such as the types of data items used in a program,
the allocation of storage so on and so forth.
Q: What types of Errors can be occurs during Testing?
A:
Three types of Errors can be occurs during
Testing:1. Logical/Semantic Errors
.2. Syntax/Compiler Errors.
3. Run time/Execution Errors.
Name the types of numeric constant?
A
: 1) Integer Constant.
2) Fixed-Point Constant.
3) Floating-Point Constant.
100
Islamabad Career Schools- Network Computer Notes - X
101
Islamabad Career Schools- Network Computer Notes - X
Example:
NOT(Unary),
AND,
OR etc.
Q:Define Computer.
A computer is an electronic data processing device. It reads data
processing and
produces results accurately at a very high speed.
102
Islamabad Career Schools- Network Computer Notes - X
Q:What is a flowchart?
Flowchart is a diagrammatic representation of algorithm. It describes what
operations
are required to solve a given problem.
Visual C++
An application development tool developed by Microsoft for
C++programmers. Visual C++ supports object-oriented programming of 32-
bit Windows applications with an integrated development environment
(IDE), a C/C++ compiler, and a class library called the Microsoft
Foundation Classes (MFC).
103
Islamabad Career Schools- Network Computer Notes - X
C#
# is a hybrid of C and C++, it is a Microsoft programming language
developed to compete with Sun's Java language. C# is an object-
oriented programming language used with XML-based Web services on
the .NET platform and designed for improving productivity in the
development of Web applications.
Sequential
In Sequential execution each statement in the source code will be executed
one by one in a sequential order. This is the default mode of execution.
Selection
The selection control structure is used for making decisions and branching
statements, the following are the basic selection statements in the
programming language.
Loop
In computer programming, a loop is a sequence of instruction s that is
continually repeated until a certain condition is reached. Typically, a certain
process is done, such as getting an item of data and changing it, and then
some condition is checked such as whether a counter has reached a
prescribed number.
Operators in C / C++
Operators are the foundation of any programming language. Thus the
functionality of C/C++ programming language is incomplete without the use
of operators. We can define operators as symbols that helps us to perform
specific mathematical and logical computations on operands.
104
Islamabad Career Schools- Network Computer Notes - X
K-MAP
105
Islamabad Career Schools- Network Computer Notes - X
Source Code
A program written in high-level language is called as source code
Compiler
Compiler is a translator which is used to convert programs in high-level
language to low-level language. It translates the entire program and also
reports the errors in source program encountered during the translation.
Interpreter
Interpreter is a translator which is used to convert programs in
high-level language to low-level language. Interpreter translates
106
Islamabad Career Schools- Network Computer Notes - X
line by line and reports the error once it encountered during the
translation process.
Sample C Program:
#include<stdio.h> <———————-Preprocessing Directive
void main()
107
Islamabad Career Schools- Network Computer Notes - X
{ <——————–Start of a Program
/*………….Printing Starts………….*/
/*………….Printing starts……..*/
} <———————-End of a Program
Uses of C
1. Operating Systems
2. Language Compilers
3. Assemblers
4. Text Editors
5. Print Spoolers
6. Network Drivers
7. Modern Programs
8. Data Bases
9. Language Interpreters
10. Utilities
108
Islamabad Career Schools- Network Computer Notes - X
Hyperlink
109