Skip to content

Instantly share code, notes, and snippets.

View prihandi's full-sized avatar

Dwi Prihandi prihandi

View GitHub Profile
# This one for terminal output
<?php
$panjang = 10;
function double_pyramid($limit) {
global $panjang;
if ($limit > 0) {
echo str_repeat(' ', $panjang - $limit ).str_repeat('*', 2 * $limit - 1)."\n";
if ($limit > 1) {
double_pyramid($limit - 1);
echo str_repeat(' ', $panjang - $limit ).str_repeat('*', 2 * $limit - 1)."\n";

#Answer for Formulatrix Software Engineering Object-Oriented Test

I used Java to create this answer.
This answer Implementing a Formulatrix Queue class from an Queue interface that can accept integers for its capacity (defined in Object initialization) The Formulatrix Queue class below also have 2 methods as required in the question (enqueue and dequeue)

This is the code ###Queue.java