UNIVERSITY of MINDANAO
College of Engineering Education
PLATE #1
The Algorithm, Pseudocode, Flowchart, and Source Code of
Half-Pyramid
Submitted to
Engr. Krisca Lynge Donayre
Submitted by
Johnrell A. Evangelista
March 3, 2019
Table of Content
Introduction/Description - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Flowchart- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
Pseudocode- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Algorithm- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Source code- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example Output- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Observation- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Conclusion - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Introduction
In geometry, a pyramid is a polyhedron formed by connecting a polygonal base and
a point, called the apex. Each base edge and apex form a triangle, called a lateral
face. ... A triangle-based pyramid is more often called a tetrahedron. The lateral
faces of a regular pyramid can be arranged to cover half of a rectangle with a height
equal to the slant height of the pyramid. The width of the rectangle is equal to the
base perimeter of the pyramid.
In this plate, it show the Algorithm, Pseudocode, Flowchart, and Source Code of
Half-Pyramid using c program that implementing logic to print half pyramid and get
the area of it.
Flowchart
A flowchart is a type of diagram that represents an algorithm, workflow or process.
The flowchart shows the steps as boxes of various kinds, and their order by
connecting the boxes with arrows.
Start
The area of the
Half-Pyramid
Enter the value of base,
Enter the value of
height
If base
=?
Print area
half=base/2;
area=(half*y)/2;
If height
End
=?
Default if
Base & height
!=number
Pseudocode
Pseudocode is an informal program description that does not contain code syntax or
underlying technology considerations. It summarizes the program flow but excludes
underlying programming details.
Begin
Input the value of base; (x)
Input the value of height; (y)
half=x/2;
area=half*y;
for (i=1; i<=y; ++i) {
for (j=1; j<=i; ++j){
cout<<" *";}
cout<<"\n";}
print Half-Pyramid
print area
end
Algorithm
The algorithm is a step by step method of solving a problem. It is commonly used for
data processing, calculation, and other related computer and mathematical
operations. An algorithm is also used to manipulate data in various ways, such as
inserting a new data item, searching for a particular item or sorting an item.
Example: the algorithm in finding the area and show the half-pyramid.
1. Get the base of the half-pyramid.
2. Get the height of the half-pyramid.
3. show the perimeter using the following code:
for (i=1; i<=y; ++i) {
for (j=1; j<=i; ++j){
cout<<" *";}
cout<<"\n";}
4 Find the area using the following equation:
Area =half of base * height
Display results.
Source Code
Example Output
Observation