Professional Documents
Culture Documents
Slide 2: Definitions
Vocabulary
What is a Computer?
Data:
Information:
Computer:
Lesson 1
Lesson 1
6: Problem
m Solving
g (cont'd
d)
pting Sho
ortcut?
7: Problem
m Solving
g (cont'd
d)
ple of Alg
gorithm Developm
D
ment
m:
st of 100 so
ocial insurance numbe
ers. Each nu
umber is on
n an index ccard.
8: Problem
m Solving
g (cont'd
d)
ple of Alg
gorithm Developm
D
ment (con
nt'd)
m:
st of 100 so
ocial insurance numbe
ers. Each nu
umber is on
n an index ccard.
ossible Solution:
hrough deck
k a first tim
me, find sma
allest numb
ber, place ca
ard at the ttop of the d
deck;
hrough remaining 99 cards
c
and find smallestt and place it second ffrom the to
op;
hrough in th
his fashion until all carrds have beeen ordered
d.
Lesson 1
11: Proble
em Solving (cont''d)
ple of Ste
eps in Pro
oblem Solving (co
ont'd)
lementatio
on
es2km.cp
pp
nvert mil
les to ki
ilometers
s.
ude <iost
tream>
namespac
ce std;
ain()
m
km
m;
double miles,
cout << "Please enter di
istance i
in miles:
:";
cin >> miles;
m
km = mil
les * 1.6
6093;
cout<"Eq
quivalent
t distanc
ce in km is :" <<
< km << e
endl;
return 0;
0
12: Proble
em Solving (cont''d)
ple of Ste
eps in Pro
oblem Solving (co
ont'd)
lementatio
on (cont'd
d)
es2km.cp
pp
nvert mil
les to ki
ilometers
s.
ude <iost
tream>
namespac
ce std;
ain()
m
km
m;
double miles,
cout << "Please enter di
istance i
in miles:
:";
cin >> miles;
m
km = mil
les * 1.6
6093;
cout<<"E
Equivalen
nt distan
nce in km
m is :" <
<< km << endl;
return 0;
0
13: Proble
em Solving (cont''d)
ple of Ste
eps in Pro
oblem Solving (co
ont'd)
lementatio
on (cont'd
d)
es2km.cp
pp
nvert mil
les to ki
ilometers
s.
ude <iost
tream>
namespac
ce std;
ain()
m
km
m;
double miles,
cout << "Please enter di
istance i
in miles:
:";
cin >> miles;
m
km = mil
les * 1.6
6093;
cout<<E
Equivalen
nt distan
nce in km
m is : <
<< km << endl;
return 0;
0
14: Proble
em Solving (cont''d)
C++ Program Sta
ages
15: Progr
ramming Errors
re three general categ
gories of errrors:
tax Errors
ons of the C++
C
gramm
mar rules
t by the com
mpiler
-Time Erro
ors
alled an exe
ecution erro
or
t during the
e running of
o the progrram
cal Errors
in design of
o program
t produce an error message
ce incorrectt output