Vous êtes sur la page 1sur 4

ICS 103: Computer Programming in C

Handout-1 Topic: Overview of Computers and Software


Obective:
To know about some historical developments in the field of Computers.
To learn about some basic things of computers.
To know about Software Development Method (i.e Steps in writing good quality program
To know how to apply Software Development Method (Steps for writing good programs.
!"at is Computer# :
Computer is an electronic machine which is used for data processing. The output which comes
after processing data through computer is known as !nformation.
Histor$ of Computers:
"e categori#ed the developments in the field of computers in the form of different computer generations
as follows $
Zero th generation (1642 to 1945) $
Mechanical calculators was developed as computing device.
First Generation (1945 to 1955) $
!n %&'( first electronic computer )*+!C ()lectronic *umerical !ntegrator and Calculator
was developed by Mr. ,.-resper )ckert and Mr. ,ohn Manuchly at .niversity of
-ennsylvania.
!t uses %/0111 vacuum tubes and its cost was 23110111.
!ts weight was 41 tons and occupied a 41 by 31 foot space.
!t produced large amount of heat.
!ts speed was very slow.
Second generation (1955 to 1965):
!n this second generation vacuum tubes were replaced by transistors.
Speed 5 performance of this generation computers was improved in comparison to first
generation computers.
Si#e0 price 0 and heat produced reduced by using transistors.
Third generation (1965 to 1971) $
!n this third generation transistors was replaced by !C6s (!ntegrated Circuits i.e fabrication
of thousands electronic components on single silicon chip .
.sing this drastic reduction in the si#e of computers.
Speed 5 performance was high in comparison to third generation.
7eat produced by computers was reduced.
Fourth generation (1971 to 1980) $
!n this generation !C6s are replaced by 8S! (8arge Scale !ntegrated Circuits $ more number
of electronic components on silicon chip.
These are low cast0 small si#e and high performance in comparisons to third generation
computers.
-age % of '
Fith generation (1980 to !resent):
!n this generation 8S! are replaced by 98S! (9ery 8arge Scale !ntegrated Circuits.
Si#e and cost of these computers is very less and performance is very high.
Components of Computer:
"o#!uter $ard%are ($&') inc(udes o((o%ing co#!onents$
Memory (Main5 Secondary.
C-.(Central -rocessing .nit:+8.(+rithmetic and 8ogic .nit;C.(Control .nit.
!5< Devices.
!"at is Program#:
Computer -rogram is a set of instructions in any computer programming language which directs
computer to do specific tasks.
Computer programs are two types one is application program and another is System -rogram.
!"at is Software %S&!' # :
Computer Software is a collection of computer programs .
S5" =s are following two types $
S)ste# Sot%are : Systems software is that software which is used to manage computer hardware
to enable us to e>ecute and write application programs5software . ?or e>ample $ <perating
Systems0 Compilers0 +ssemblers0 !nterpreters etc.
*!!(ication Sot%are: +pplication software are those software which are meant for solving users
own problems. ?or e>ample$ "ord -rocessors0 @ames -rograms0 Spread Sheets0 Data Aase
Systems0 @raphics -rograms etc.
(ist of some "ig"er )eve) programming )anguages:
?<BTB+*0 -ascal0 A+S!C0 C0 C;;0 ,ava etc.
!"at is Compi)er# :
Compiler is a System Software which is used to translate higher level language source code into machine code. ?or e>ample$ C
C compiler 0 ?<BTB+* compiler.
!"at is bit* b$te* +,- and .,-#:
%Dbit(binary digit : 1 or %.
%Dbyte : group of / bits
%D kilobyte (E.A :

%1F' (i.e F
%1
bytes
%Dmegabyte (M.A : %1F' > %1F' ( i.e F
F1
bytes
%Dgigabyte (@.A : %1F' > %1F' > %1F' (i.e F
41
bytes
Steps for good /ua)it$ Program& Software deve)opment:
To develop reliable and good quality -rogram5Software we need to follow the following 3 steps $
-age F of '
%. Bequirement Specification.
F. +nalysis.
4. Design.
'. !mplementation.
3. 9erification and testing.
For Example$
Take a case study for finding the area and circumference of a circle (see
below how we follow the above five steps to solve this problem).
1+ ,ro-(e# or .e/uire#ent S!eciication $
Take the radius of a circle and compute and print its area and circumference.
2+ *na()sis:
Clearly0 the problem input is the circle radius. There are two outputs requested$ the area of circle and
its circumference. ?rom our knowledge of geometry0 we know the relationship between the radius of a
circle and its area and circumferenceG we list these formulas along with the data requirements.
0ata re/uire#ents:
-! 4.%'%3&
,ro-(e# 1n!ut:
Badius
,ro-(e# out!uts:
area 0 circum
.e(e2ant For#u(as:
area of circle : r
2
Circumference of circle = 2 r
3+ 0esign:
<nce you know the problem inputs and outputs0 you should list the steps necessary
to solve the problem .
!t is very important that you pay close attention to the order of the steps.
*(gorith# :
Step%$ @et5!nput circle radius.
StepF$ area:-!HradiusHradius.
Step4$circum: FH-!Hradius.
Step'$ print area and circumference.
-age 4 of '
4+ 1#!(e#entation:
!n implementation phase we convert our algorithm into actual program using any
-rogramming language which is given below$
&4 "a(cu(ates and dis!(a)s the area and circu#erence o a circ(e 4&
Iinclude Jstdio.hK // preprocessor directive
Idefine -! 4.%'%3& // preprocessor directive
int main(void // main function
L
double radius0 area0 circumG /* Variable declarations */
/* Get the circle radius */
printf(M)nter radius $ MG
scanf(MNlfM0 OradiusG
/* Calculate the area */
area : -! H radius H radiusG
/* Calculate the circumference */
circum : F H -! H radiusG
/* Display the area and circumference */
printf(MThe area is $ NfPnM0 areaG
printf(MThe circumference is $ NfPnM0 circumG
return (1G
Q // end of main
Sa#!(e 5ut!ut :
)nter radius $ 3.1
The area is $ R/.34&R31
The circumference is $ 4%.'%3&11
5+ Testing:
?or testing input different radius values and verify results with standard results.
-age ' of '

Vous aimerez peut-être aussi