0% found this document useful (0 votes)
19 views27 pages

Section 8 - Program Implementation

Uploaded by

Merecia Smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views27 pages

Section 8 - Program Implementation

Uploaded by

Merecia Smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

2/13/2025

INFORMATION TECHNOLOGY
Unit 1: Computer Unit 8: Program Implementation
Fundamentals

Distinguish between low-level and high-level


programming languages
Low-level languages
• These are languages that are machine dependent.
• Different brands of computers use different program codes.
• The program code written for a particular brand of CPU will not run on another brand of CPU as
the codes are written with the internal operations and architecture of a particular CPU in mind.
• Examples of low-level languages are Machine language and Assembly language.

High-level languages
• These are languages that are machine independent.
• They are not specifically written for any one brand of computer.
• The program code written on a particular machine is not limited to execution on that machine only
but can also run on other similar machines.
• Examples of high-level languages are Pascal, BASIC, C, etc.

www.caribbeanonlineacademy.com

1
2/13/2025

List the sequence of steps associated with


implementing a program
Steps in implementing a program:
(a) create source code;
(b) Compile source code
(c) translate and/or link (on some systems this step is transparent to users);
(d) execute/run program; and,
(e) maintain program.

1. Creating the source code involves:


• The translation of the algorithm into a programming language
• This process is done manually on paper
• The resulting Pascal program is entered into the computer using a suitable text editor
• The source code is then stored in a file with the appropriate extension (.pas)
• At the completion of this process, a complete Pascal program is ready for
compilation.
www.caribbeanonlineacademy.com

List the sequence of steps associated with


implementing a program
2. Compiling the source code involves:
• The process of translating the source code into object code.
• Object code is the machine language equivalent of the source code.
• During the compilation process the syntax of the source code is checked to ensure
conformity with the rules of the language.
• If syntax errors are found, these are reported.
• Syntax errors result in incomplete compilation.
• The errors must be corrected and the program must be re-compiled.
• This process is repeated until the code is free of syntax errors.
• The primary purpose of the compiler is to translate the source code into object code.

www.caribbeanonlineacademy.com

2
2/13/2025

List the sequence of steps associated with


implementing a program
3. Linking the Modules
• This is where special operations code is added to the object code.

• A compiled object program is not executable by itself. It needs to be combined with other

system modules to form an executable image that can be loaded into memory.
• The process of linking the module is done by a link editor or link-loader.

• The resulting executable module is then loaded into memory where it can then be executed.

www.caribbeanonlineacademy.com

List the sequence of steps associated with


implementing a program
4. Program Execution:
• This is when the instructions in a program get carried out.
• The program is dispatch to the CPU and the control unit interprets each instruction and

pass it to the appropriate unit for execution


• During execution, if any run – time errors are detected, the program will terminate

prematurely.

5. Maintaining the program involves:


• Making periodic modifications to the program when the requirements change.
• For example, if the hourly rate for an employee changes, due to pay increase, then such a program

would have to be modified to reflect the change in the hourly rate.

www.caribbeanonlineacademy.com

3
2/13/2025

List the sequence of steps associated with


implementing a program
• A program written in any programming language is called the source code.
• The source code has to be translated into machine code before it can be executed.
• A translator is needed for this purpose. The machine code is saved as an executable file.
• The executable program file is called the object code.

• A diagram Outlining the Compilation Process

Source Code Compiler Object Codes

• There are two types of computer translators:


1. Interpreters
2. Compilers

www.caribbeanonlineacademy.com

Difference Between an Interpreter and a


Compiler
• An interpreter translates and executes one instruction at a time as it is encountered.

Advantages
• It translates one instruction at a time, therefore it uses a minimum amount of the

computer’s memory
• It is also helpful in the debugging process, as the interpreter can relate error

messages to the instruction being executed.

Disadvantage
• The interpreter takes longer to run a program as time is spent interpreting the source code every
time the program needs to be run.

www.caribbeanonlineacademy.com

4
2/13/2025

Difference Between an Interpreter and a


Compiler
Compiler
• A compiler translates the entire program (source code) to machine code, and then the machine
code is executed. The translated codes are known as object codes.

Advantage
• It can be executed faster than when using an interpreter, as the object codes are saved and can
be run at any time

Disadvantage
• As the entire program is translated to object code, it uses much more of the computer’s
memory.

www.caribbeanonlineacademy.com

Explain commonly used terms and concepts


in programming
• Loading – is reading a program from the hard disk into main memory (RAM)

• Testing - a completed program must be tested for errors to prevent crashing or stalling.
• The programmer must make sure the program works for any correct input data that the
user gives it.
• The testing phase is to detect any problems in the program.
• Dry runs and computer testing could reduce the chance of error, before releasing the
program to its final users.

• Dry runs/Manual testing - a manual traversal of the logic of a program.


• A dry run is carried out when the action of an algorithm is examined with a set of input values.
• A trace table is a useful tool for a dry run, to check how the program would behave.

www.caribbeanonlineacademy.com

5
2/13/2025

Explain commonly used terms and concepts


in programming
• Test Data – a wide range of data should be used to test a program.
• This data should include normal data values and extreme values e.g. large,
small and negative numbers.
• Using this wide range would help detect which values might cause a program to
fail.
• Debugging – is the process of correcting or removing errors from a program
before it is put into operation.
• Program Errors – A program error is a mistake/error in a program and is also
known as a bug.

www.caribbeanonlineacademy.com

Types of errors
During program development, three types of errors may be encountered as followed:
1. Logic errors
2. Syntax errors
3. Run-time errors

1. Logic errors – arise when the sequence of the instructions is not correct and there are flawed comparisons
and selection statements.
For example, let’s suppose we wanted to print the names of all girls who are under the age of 18 and we
wrote the following program:
If (gender = F) and (age <= 18) then
Writeln(name);

• This code would result in the printing of the names of girls who are 18 as well as those who are under 18.
• This is because in the if statement, we used <= instead of = .
• This is a common error in the logic that will give undesirable results.

www.caribbeanonlineacademy.com

6
2/13/2025

Types of errors
2. Syntax errors – occur when the source code has not been written in accordance with the rules of the
programming language.
• For example, if we omit to terminate an assignment statement with a semicolon.
• The following statement would result in a syntax error during compilation:

total:=total + X
or if we used a reserved word incorrectly, such as in: var := a + b;
• Syntax errors can be easily located and corrected as the compiler usually issue messages which identify
the location and cause of the errors.

www.caribbeanonlineacademy.com

Types of errors
3. Run-time errors – are generated during execution of the program.
• They result when the processor encounters an instruction that violates the processing rules.

• For example, if we had an instruction that attempts to divide by 0, such as:

• Number:=1;
• Number:= Number - 1;
• Answer := total/Number; {illegal}

• The last statement would generate a run-time error as an attempt is being made to divide by a value
of 0.

www.caribbeanonlineacademy.com

7
2/13/2025

A Basic Pascal Program Layout


Program
header

Declaration program < program name > ;


of variables const <constant name> = <value >;
var < variable name>: <data type >;
Begin

Program
body End.

www.caribbeanonlineacademy.com

Declaring variables and their data types


Data types used in Pascal:
• Integer: for storing whole numbers
• Real: for storing decimal numbers
• String: for storing a set of characters
• Boolean: for storing ‘true’ or ‘false’
• Char: for storing characters

www.caribbeanonlineacademy.com

8
2/13/2025

Declaring variables and their data types


Identifiers
Names made up by the programmer for variables etc. The rules for naming identifiers are:
• It must start with a letter or underscore e.g. R, sum , _total
• They can be made up of any combination of letters, digits or underscore e.g. _xyz,
turns_per_game
• The length of an identifier cannot exceed 31 characters
• Spaces are not allowed in an identifier
• Reserved words cannot be used as an identifier
Suggestions for Naming Identifiers
• Write variable names in lowercase
• Begin constants with an uppercase letter
• If identifiers consist of more than one word, start second or subsequent words with an
uppercase e.g. numberOfThrows

www.caribbeanonlineacademy.com

Declaring variables and their data types


Declaring constants
• Constant declarations must come immediately after the program heading and before the variable
declarations.
• Constants are declared in Pascal by specifying the keyword const followed by an identifier, an equal sign
(=), a constant value (numeric, character, string, or Boolean) and a semicolon.
• If more than one constants need to be declared, do not repeat the keyword const, simply list each identifier
and assign the constant value to them.
• E.g. const pi = 3.142;
ans =’TRUE’;
val =’A’;

www.caribbeanonlineacademy.com

9
2/13/2025

Declaring variables and their data types


• Variables must always be declared in the variable declaration section.
• Variables are declared in Passcal by specifying the keyword var followed by an identifier, a colon and the
data type.
• Variables of the same type can be listed in the same line separated by commas.
• Variables of different data types are to listed on separate lines E.g.
var num1, num2 : integer;
average : real;
ans : char;

• Punctuation
• Every Pascal statement (except begin) is terminated by a semi-colon.
• The last statement in the program (that is the end statement) is terminated by a period (full stop).

www.caribbeanonlineacademy.com

Declaring variables and their data types


BEGIN and END delimiters
• The BEGIN/END keyword pair is used to delimit the body of the program as well as logical blocks within
the program.
• For example, when multiple statements are to be executed within a while loop.
• N.B. For every BEGIN in a program, there must be corresponding END statement.

www.caribbeanonlineacademy.com

10
2/13/2025

Translate algorithmic statements into


high-level language syntax
Arithmetic Operators
• + add div divide (throws away the remainder in result)
• - subtract mod remainder
• * multiply
• / division

Precedence of operators
• Same as in Math; multiplication and division before addition and subtraction.
• When two operators have the same precedence evaluate from left to right unless specified
otherwise by brackets.

www.caribbeanonlineacademy.com

Translate algorithmic statements into


high-level language syntax
The assignment statement (:=)
• There is no space between the colon and equal sign. It is used as:
• <variable := <value>;
Or
• <variable>:= <calculation statement>;

Writeln and write - Used to produce output.


• writeln(<variable name>); write(<variable name>);
Or
• writeln(<variable with string constant> );
• write(<variable with string constant>);

www.caribbeanonlineacademy.com

11
2/13/2025

Translate algorithmic statements into


high-level language syntax
• Writeln prints output and the cursor moves to the next line.
• Write produces the output and the cursor stays on the same line.
• Write is suitable when prompting the user for data as the program waits on the same line for the
user to type in the data requested.

Readln and read - Used to get data entered by the user.


• readln(<variable name>); read(<variable name>);
• or
• readln(<variable name>, <variable name>); read(<variable name>, <variable name>);

www.caribbeanonlineacademy.com

Translate algorithmic statements into


high-level language syntax
• When the read and readln commands are executed, the computer anticipates the variables in the
order listed and the types declared.
• If an incorrect type is entered an error message is displayed. E.g.
Var num:integer;
Total:real;
Read( num, total);

• The computer expects that and integer would be entered first and a decimal number next.
• Read and readln differ in where the data pointer is place after a data item is read.
• The read command places the pointer in the space just after the data item whereas readln places
the data pointer on a new line.
• Therefore be careful how readln is used.

www.caribbeanonlineacademy.com

12
2/13/2025

Translate algorithmic statements into


high-level language syntax
• Consider the following data entries and statements:
4000 7.99 8
3575 10 44
5600 25.0 1
Readln(item);
Readln(price);
Readln(quantity);
• The intention is to store 4000 in item, 7.99 in price and 8 in quantity and so on.
• Based on the sequence of statements above this will not happen.
• Instead item will store 4000, price will store 3575 and quantity will store 5600.

www.caribbeanonlineacademy.com

Translate algorithmic statements into


high-level language syntax
• To do what was intended, either of the following is required:
• Read(item); Read(price); Read(quantity);
• Or
• Readln(item, price, quantity); (repeated three times)

www.caribbeanonlineacademy.com

13
2/13/2025

Selection statements/Conditional branching


• In Pascal, the IF…THEN construct is written as follows
IF (condition) THEN e.g. IF (num > 20) THEN
<statement>; OR ans := num/5;

IF (condition) THEN e.g. IF (age > 18) THEN


BEGIN BEGIN
<statement>; status:= ‘adult’;
<statement>; admit:= TRUE;
END; END;

www.caribbeanonlineacademy.com

Repeat or Looping Statements


• These use the FOR, WHILE and REPEAT..UNTIL constructs.
• These constructs allow us to repeat certain parts of a program a number of times without having to
write them several times.
• For each of these constructs it is necessary to keep a count of how many times the instructions are
repeated.
• The counting or iterations involves increasing the value of a counter variable by a fixed number
every time the instructions are repeated.

Loops
• The group of statements/instructions to be repeated is called a loop. There are two (2) types:
1. A finite loop – where the number of times a repetition is to be made is known.
2. An infinite loop – where the instructions are repeated an unspecified number of times.

www.caribbeanonlineacademy.com

14
2/13/2025

Repeat or Looping Statements


• To exit a loop a sentinel, terminal or end-of-data value is used.
• A sentinel value is a lookout value such that if the data being entered ever becomes equal to the
sentinel value, the computer exits the loop.
• This value can be entered by the user or the computer can be programmed so that a certain
condition can be met to trigger the end of the loop.

WHILE loop
• This construct is used when you do not know beforehand how many times a statement within a
block needs to be repeated.
• In this loop the computer executes the instruction to be repeated for as long as a given condition is
TRUE.
• It checks the conditions first and will loop while the condition is true and ends when it is false.

www.caribbeanonlineacademy.com

• Syntax:
While (<condition>) Do
Begin
<statement(s) to be carried out if condition is TRUE>;
End;

• Example
Program Read100Nums;
Uses wincrt;
Var number: integer;
Begin
Write(‘Enter a number’);
Read (number);
While( number<=100) Do
Begin
Write(‘Enter a number’);
Read (number);
End;
Write(‘Over the limit’);
www.caribbeanonlineacademy.com
End.

15
2/13/2025

Repeat or Looping Statements


Counting in a WHILE loop
• To keep a count in a WHILE loop the following syntax is used:
• <counter variable>: = <counter variable> + < increment value>;
• N.B. When a count is being kept, the counter variable MUST be initialized (set) to a starting
value, usually zero (0), before the instructions are executed.

Syntax to initialize a variable:


• <counter variable>: = 0;

www.caribbeanonlineacademy.com

Repeat or Looping Statements


• E.g. This program uses a counter to write “Hello” five (5) times

Program hello5;
Uses wincrt;
Var Count: integer;
Begin
Count := 0;
While (count<5) Do
Begin
Writeln(‘Hello’);
Count:= Count +1;
End;
Readkey;
End.

www.caribbeanonlineacademy.com

16
2/13/2025

Repeat or Looping Statements


FOR loop
• This construct is used when the number of times a set of instructions has to be repeated is known.
• Syntax:

FOR < counter variable> :=<start value>To <end value or end variable> Do
<statement to be carried out if condition is TRUE>;
End;

• Example
FOR num := 1 To 5 Do
Writeln(‘Hello’);
End;

www.caribbeanonlineacademy.com

Repeat or Looping Statements


• If more than one statement has to be repeated, a BEGIN & END must be use to mark the
beginning and end of the block of code.
• Syntax:

FOR <counter variable> :=<start value>To <end value or end variable> Do


BEGIN
<statement 1>;
<statement 2>;
<statement 3>;
END;

www.caribbeanonlineacademy.com

17
2/13/2025

Repeat or Looping Statements


• Example

FOR count := 1 To 5 Do
BEGIN
Sum := count + count;
Writeln(count, ‘ + ’, count, ‘ = ‘,sum;
END;

www.caribbeanonlineacademy.com

Repeat or Looping Statements


• The FOR loop can be used to count in descending order.
• To do so, the reserved word DOWNTO is used instead of TO
• Syntax:

FOR < counter variable> :=<start value>DOWNTO <end value or end variable> Do
<statement to be carried out if condition is TRUE>;
End;

• Example
FOR count := 5 DOWNTO 1 Do
Writeln(count);
End;

www.caribbeanonlineacademy.com

18
2/13/2025

Repeat or Looping Statements


• N.B. It is possible to increment or increase the counter variable by more than 1 for each repetition.
• To do so, the reserved word STEP is used.
• Syntax:

FOR <counter variable> :=<start value>To <end value or end variable> Step <increment
value>Do
<statement to be carried out if condition is TRUE>;
End;
• Example
FOR even_No := 2 To 20 STEP 2 Do
Write(even_No);
End;

www.caribbeanonlineacademy.com

Repeat or Looping Statements


Repeat .. Until Loop
• This construct is similar to the WHILE loop, in that, it can be used when you do not know
beforehand how many times a statement within a block needs to be repeated.
• The difference between the WHILE and the REPEAT..UNTIL is that, the computer executes the
instruction(s) to be repeated for as long as a given condition remains FALSE and ends when it
becomes TRUE.
• Because of this, the instruction(s) to be repeated is/are always executed at least once.
• Therefore, be very careful when using it.
• Syntax:
Repeat
<statement(s) to be carried out if condition remains FALSE>;
Until (<condition>);
• N.B. The reserved words REPEAT and UNTIL replaces the BEGIN and END used in the other
loops.
www.caribbeanonlineacademy.com

19
2/13/2025

• Example:
Problem:
• Write a program to allow a user to enter numbers. When his total crosses 100 display “over the
limit”.

Program overTheLimit;
Uses wincrt;
Var number , Total: Integer;
Begin
Total:=0;
Repeat
Write(‘Enter a number ‘);
Readln( number);
Total := Total + number;
Until (Total >100);
Write(‘Over the limit’);
End.

www.caribbeanonlineacademy.com

Top-Down Design
Top-Down Design
• In TDD, the idea is to design a program by first identifying the major tasks of the program.
• For each task, break it down into smaller subtasks.
• Continue this process until it is clear how each task is to be accomplished.
• Each task that you have identified is a candidate to be a subprogram, with the main program
consisting mostly of calls to the top-level subtasks.
• This approach requires that you have the discipline to plan the structure of your program before
you write any code.
• If you can do it, the process of planning the program will help minimize the number of logical
errors in your program.
• Typically, you'll spend less time planning than you would have spent debugging the code you
didn't plan.

www.caribbeanonlineacademy.com

20
2/13/2025

Perform checks and tests on programs to


verify correctness
Testing and Debugging Techniques
• Once a program is developed or written, the next step is to check that it is doing what it was
designed to do, and is doing so correctly.
• There are two types of testing:
• Manual testing/dry running: executing the program manually by using input values

for variables and recording what takes place after each instruction is executed.

• Computer testing: using the computer to run the program with suitable test data
(correct and incorrect) to deal with all possible kinds of conditions.
• The results generated by the computer are then compared with the expected
solutions.
• If the expected and actual results do not match, then the program has a logic error.

www.caribbeanonlineacademy.com

Write documented programs


Documenting a Program
• Documentation is the written guidelines that help program users to operate the program.
• Once Comments in Pascal
• Single line comments can be put in opening and closing brackets with opening and closing asterisk e.g.
• (* This is a single line comment. *)
or
• (* EndFor*)
• Multiple line comments are enclosed in opening and closing curly brackets e.g.
• {These are multiple line comments.
N.B. Always remember to close comments.}
• // the double slash for comment the rest of the current line.
• Modern Pascal also supports the C style /* ... */ for single or multiple lines of comment.

www.caribbeanonlineacademy.com

21
2/13/2025

Write documented programs


Documenting a Program Continue…
• (* This is an example of a single line comment in this style *)
• (* This is an example of using this style for multi-line comments as it will span multiple lines.
*)
• {This is an example of a single line comment in this style}
• {This is an example of this style for multi-line comments as it will span multiple lines.}
• // Lastly, this is a single line comment - or var a:Integer; // comment the rest of this line, or
about this line.
• /* Modern Pascal also supports C/Java/JavaScript style of comments which use the slash
asterisk combination instead of parenthesis asterisk combination (like formal Pascal) */

www.caribbeanonlineacademy.com

Write documented programs


INDENTATION

There are dozens of indentation styles that you could adopt, and some general ideas are common to
most of them:
1. The style is applied consistently throughout the program.
2. Code within a block (e.g., inside a loop, or in the body of a subprogram) should be indented.
3. If a block is nested within another block the inner block's body should be indented relative to the
enclosing block.
4. Avoid excessive "stairstep" indentation (such as you often see with groups of nested IF statements)
because this will force you to attempt to squeeze code to fit on just the right half of the
screen/page.
5. If stairstepping becomes a problem, reduce the number of spaces per indentation (from 8 to 4, for
example) or switch to a vertical style temporarily.

www.caribbeanonlineacademy.com

22
2/13/2025

Write documented programs


MEANINGFUL VARIABLE NAMES

You should strive to give each object a name that gives the reader a strong hint as to the object's
purpose within the program. As with indentation, there are some principles that apply to naming:
1. Use good, meaningful names, but don't go overboard. If you have a variable in your program that
holds the number of hours an employee works in a week, you might call it HOURS, although that
name still leaves a lot of doubt as to the exact contents of the variable. A compromise such as
HOURS_PER_WEEK is a good solution.
2. Many languages now permit you to use underscores as part of names, as shown above. If you can't
use them, you can still improve name readability by mixing the case of the letters in the name. For
example, 'HoursPerWeek' is much easier to read than 'hoursperweek'.

www.caribbeanonlineacademy.com

Write documented programs


MEANINGFUL VARIABLE NAMES Continue…
3. Always place a comment with each variable name declaration. The comment should give a brief
phrase or sentence that explains the purpose of the variable. If the variable name itself isn't
enough to make the purpose of the variable clear to the reader, the comment should clear up any
confusion.
4. Common abbreviations are often acceptable in variable names. For example:
HRS_PER_WEEK. But don't get carried away; HRS_P_WK simply is not a good name.

www.caribbeanonlineacademy.com

23
2/13/2025

Write documented programs


INTERNAL DOCUMENTATION
The variable declaration comments are one part of good internal documentation. Internal
documentation is the set of comments that are included within the code to help clarify algorithms.
Here's a list of items that should be included in your internal documentation:
1. "Block comments" (comments that are several lines long) should be placed at the head of every
subprogram. These will include the subprogram name; the purpose of the subprogram; and a list of
all parameters, including direction of information transfer and their purposes.
2. Meaningful variable names. Simple loop variables may have single letter variable names, but all
others should be meaningful. Never use nonstandard abbreviations.
3. Each variable and constant must have a brief comment next to its declaration that explains its
purpose. This applies to all variables, as well as to fields of record declarations.
4. Complex sections of code and any other parts of the program that need some explanation should
have comments just ahead of them or embedded in them.

www.caribbeanonlineacademy.com

Write documented programs


INTERNAL DOCUMENTATION Continue…
• N.B. Documentation, and internal documentation in particular, should be written and included in
the program as the code is being written. Documentation should be written when the code is being
written, and should be typed in as the code is typed in.

www.caribbeanonlineacademy.com

24
2/13/2025

Write documented programs


EXTERNAL DOCUMENTATION
• Serves as a general description of the project, including such information as what the code does,
who wrote it and when, which common algorithms it uses, upon which other programs or libraries
it is dependent, which systems it was designed to work with, what form and source of input it
requires, the format of the output it produces, etc.
• Often the external documentation will include structure charts of the outline of the program that
were produced when the program was being designed.
• All of this information is necessary to help other programmers understand the program.
• One seemingly innocent change in a program can have unpredictable consequences on other parts
of the system. Good documentation can help prevent such problems.

www.caribbeanonlineacademy.com

Write documented programs


1. Your name, the course name, assignment name/number, instructor's name, and due date.
2. Description of the problem, the program was written to solve.
3. Approach used to solve the problem. This should always include a brief description of the major
algorithms used, or their names if they are common algorithms.
4. The program's operational requirements: Which language system you used, special compilation
information, where the input can be located on disk, etc.
5. Required features of the assignment that you were not able to include.
6. Known bugs should be reported here as well. If a particular feature does not work correctly, it is in
your best interest to be honest and complete about your program's shortcomings.

www.caribbeanonlineacademy.com

25
2/13/2025

Basic Structure Of Pascal Programs


Header
Program documentation
Program name (input and output operations);

Declarations
const
var
:

Statements
begin
:
end.
www.caribbeanonlineacademy.com

Details Of The Parts Of A Pascal


Program
• Headers
• Program documentation
• Version number, date of last modification, what does the program do etc.
• Comments for the reader of the program (and not the computer)
(* Marks the beginning of the documentation
*) Marks the end of the documentation
• Program heading
• Name of program, input and/or output operations performed by the program
• Example
(*
* Tax-It v1.0: This program will electronically calculate your tax return.
*)
program taxIt (input, output);

www.caribbeanonlineacademy.com

26
2/13/2025

Details Of The Parts Of A Pascal


Program (2)
• Declarations
• List of constants and variables
• More to come later in this section of notes
• Statements
• The instructions in the program that actually gets stuff done
• They tell the computer what to do as the program is running
• Each statement is separated by a semicolon ";"
• Much more to come later in the course

www.caribbeanonlineacademy.com

27

You might also like