[go: up one dir, main page]

0% found this document useful (0 votes)
39 views4 pages

Pseudocode Activity

The document outlines three algorithms developed by Olukemi Ogunde on October 4, 2024, for calculating the area and perimeter of a rectangle, as well as the amount due for a purchase. Each algorithm includes input, processing, and output steps, along with pseudocode for implementation. The algorithms are designed to read user inputs and perform basic arithmetic operations to produce the desired results.

Uploaded by

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

Pseudocode Activity

The document outlines three algorithms developed by Olukemi Ogunde on October 4, 2024, for calculating the area and perimeter of a rectangle, as well as the amount due for a purchase. Each algorithm includes input, processing, and output steps, along with pseudocode for implementation. The algorithms are designed to read user inputs and perform basic arithmetic operations to produce the desired results.

Uploaded by

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

1. A program is required to read the length and width of a rectangle. Calculate and print the area of the rectangle.

Input Processing Output


Read Read length, width Print area
Length, Calculate area
Width Area – length*width
Print area
Pseudocode Algorithm: Area of a rectangle

Author/Developer: Olukemi Ogunde

Date: October 4, 2024

This algorithm will find the area of a rectangle

Declare length, width, Area as real

Length, width, area ←0

START

Print “Enter length, width”

Read length, width

Area ← length*width

Print “The area is”, Area =

STOP
2. A program is required to read the length and width of a rectangle. Calculate and print the perimeter of the rectangle.

Input Processing Output Pseudocode Algorithm: Perimeter of


Read Read length, width Print perimeter
a rectangle
Length1, Calculate perimeter
Width1, Perimeter – (length + width)*2 Author/Developer: Olukemi Ogunde
Print perimeter
Date: October 4, 2024

This algorithm will find the perimeter of a rectangle

Declare length, width, perimeter as real

Length, width, perimeter – 0

START

Print “Enter length, width”

Read length, width

Perimeter – (length + width) *2

Print “The perimeter is”, Perimeter =

STOP
3. A program is required to input the price of an item and quantity purchased. The program should compute and print the amount due.

Input Processing Output


Read Read price, quantity Print amount_due
Price, Calculate amount due 2
quantity Amount_ due price*quantity
Print amount_due Pseudocode Algorithm: Amount due
for a purchase

Author/Developer: Olukemi Ogunde

Date: October 4, 2024

This algorithm will find the amount due for the purchase of an item.

Declare price, Amount_due as real

Declare quantity as integer


Price, quantity, amount_due 0

START

Print “Enter price, quantity”

Read price, quantity

Amount_due price*quantity

Print “The amount due is”, Amount due

STOP

You might also like