343x Filetype PDF File size 0.53 MB Source: pages.cpsc.ucalgary.ca
Getting Started With Pascal
Programming
How are computer programs created
What is the basic structure of a Pascal Program
Variables and constants
Input and output
Pascal operators
Common programming errors
Introduction to program design and problem solving
James Tam
Reminder: About The Course Textbook
It’s recommended but not a required purchase.
However the course notes are required for this course
James Tam
Getting Started With Pascal Programming 1
Reminder: How To Use The Course Resources
They are provided to support and supplement this class.
Neither the course notes nor the text book are meant as a
substitute for regular attendance to lecture and the tutorials.
James Tam
Reminder: How To Use The Course Resources (2)
procedure add (var head : NodePointer;
var newNode : NodePointer);
var
temp : NodePointer;
begin
if (head = NIL) then
head := newNode
else
begin
temp := head;
while (temp^.next <> NIL) do
temp := temp^.next;
temp^.next := newNode;
end;
newNode^.next := NIL;
end;
James Tam
Getting Started With Pascal Programming 2
Reminder: How To Use The Course Resources (2)
e .
procedure add (var head : NodePointer; .
k .
a n c wh
m o e
l
va r newNode : NodePointer); a n
s p s
s u s s y
var a u o
cl h p m u
c t
a at e ) y p a d
g s o l k o
temp : NodePointer; e e
s c ( e u
m
s u d t a r s m
i o i e u
begin o e n n o n a
m y s w r k
s s t t t e e
u t i h g n t
o a s e o h th i
if (head = NIL) then n t
y h m a n e a
t l o t
f e n t o
I u c x t s
e o a e l y
r s a s i
head := newNode d o
u y e’ m r e u
s t s e (c s
a on m a
else
h i e u w
w e f m s i
m y e th
begin o b
so u er y
d ou
o i
temp := head; n t
i
’ n
while (temp^.next <> NIL) do t)
temp := temp^.next;
temp^.next := newNode;
end;
newNode^.next := NIL;
end;
James Tam
But Once You’ve Made An Attempt To Catch Up
Ask for help if you need it
There are no dumb questions
Image from “The Simpsons” © Fox James Tam
Getting Started With Pascal Programming 3
Don’t Forget: How To Succeed In This Course
1. Practice things yourself
2. Make sure that you keep up with the material
3. Look at the material before coming to lecture
4. Start working on things early
James Tam
Computer Programs
Binary is the language of the computer
Translator
e.g., gpc 3) An
executable
1) A programmer program is
writes a computer 2) A translator created
program converts the
program into a
form that the
computer can 4)Anybody who has
understand this executable
installed on their
computer can run
(use) it.
James Tam
Getting Started With Pascal Programming 4
no reviews yet
Please Login to review.