Professional Documents
Culture Documents
VARIABLES: are identifiers that can change. Place holders found in memory.
1. Input Statements
This is the way in which it will be written: Read variable_name
For example, if you were required to read two numbers, find the sum of the numbers and output
the sum of the numbers. The input statement would be:
Eg. Read num1
Read num2
2. Output Statements
This is the way in which it will be written:
Print “The average is ”, AVG Or Print AVG
For example, if you were required to read two numbers, find the sum of the numbers and output
the sum of the numbers. The output statement would be:
3. Assignment Statement
This is the way in which it will be written: variable_name = expression
An assignment statement may involve an arithmetic operation, such as:
sum num1 + num2
While some assignment statements just involve assigning values to variables, such as:
Count 1
Highest_Price 0
Parts of a Pseudocode Algorithm
Algorithm Header
Algorithm Name
Author
Date
Description: State what the code is about.
Declaration: State ALL the variables/constants and specify the data types.
Start
Body (Input, output and assignment statements)
Stop
Example one: Write the Pseudocode Algorithm for a program that is required to accept two
numbers. Calculate a print the sum.
2. A program is required to input the price of an item and quantity purchased. The program
should compute and print the amount due
Additional Notes
Arithmetic operators are symbols that allow you to perform mathematical processes.
ARITHMETIC OPERATORS EXAMPLES
Final_cost Price_1*quantity
Question 1
A program is required to prompt a user to enter the price and quantity of an item.
Calculate and print the final cost.
Write the corresponding Pseudocode algorithm for the above IPO chart.
To do.
Write a program that is required to calculate and print the cost of an item given the
price and quantity. Calculate a 5% discount of the item cost to produce the final
cost that the customer is required to pay.