Implement Class

Class Fraction

Fraction
- numerator: int
- denominator: int
- greatestCommonDivisor(int a, int b): int
+ input(): void
+ output() const: void
+ simplify(int a, int b): void
+ plus(const Fraction &f): Fraction
+ minus(const Fraction &f): Fraction
+ multiply(const Fraction &f): Fraction
+ divide(const Fraction &f): Fraction

Class Array

Array
- a: *int
- capacity: int
- n: int
- swap(int &a, int &b): void
+ add(int item): void
+ output() const: void
+ removeAt(int index): void
+ clear(): void
+ sort(bool isAscending = true): void
+ get(int index): int
+ set(int index, int val): void

Class Point2D

Point2D
- x: double
- y: double
+ Point2D(double x = 0, double y = 0)
+ set(double x, double y): void
+ output() const: void
+ distance(const Point &p): double

Class Circle

Circle
- center: Point2D
- radius: double
+ Circle(const Point2D &center, double radius)
+ Circle(double x, double y, double radius)
+ set(double x, double y): void
+ output() const: void
+ area(): double
+ perimeter() : double()

Class Stack

Stack
- capacity : int
- element: double
- int: top
+ Stack(int capacity)
+ push(double item)
+ top const: double
+ pop(): void
+ isFull(): bool const
+ isEmpty(): bool const

Class Queue

class Queue{
	struct Node{
		int item;
		Node* next = NULL;
	};
	static Node* getNode(int item);
public:
	Node* front = NULL; //Pointer to front of Queue
	Node* rear = NULL; //Pointer to rear of Queue
	Queue();
	~Queue();
	bool isEmpty() const;
	bool enqueue(const int& item);
	bool dequeue();
	int peek() const;
};