// Programming Technique II (SECJ1023)
// Semester 2, 2020/2021
// Tutorial 2: Procedural Programming (PP) vs. Object-Oriented Programming (OOP)
// Program 1: Using PP approach
// Megat Irfan Zackry (A20EC0205)

#include <iostream>
#include <iomanip>
using namespace std;

void drawRectangle(int w, int h)
{
	for (int i=0; i < w; i++){
		cout << "-";
	}
	for (int i=0; i < h; i++){
		cout << endl << ":" << setw(w) << ":" << endl;
	}
	cout << endl;
	for (int i=0; i < w; i++){
		cout << "-";
	}
}

void calcRectangleArea(int w, int h)
{
	int area = w*h;
	cout << endl << endl << "Rectangle area is = " << area;
}

int main()
{
	int w = 30, h = 5;
	cout << "This rectangle of width = " << w << " and height = " << h << endl << endl;
	drawRectangle(w, h);
	calcRectangleArea(w, h);
	return 0;
}
