From 5cb6caaf4bea7996deb02dce391e03457e77f507 Mon Sep 17 00:00:00 2001 From: AhmedNoureldinAhmed <44178039+AhmedNoureldinAhmed@users.noreply.github.com> Date: Mon, 31 Dec 2018 19:19:53 +0200 Subject: [PATCH] ..... --- problem-1/array.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/problem-1/array.h b/problem-1/array.h index 6d39967..15081bb 100644 --- a/problem-1/array.h +++ b/problem-1/array.h @@ -3,4 +3,58 @@ // Put your class declaration here +class arr { + +private : + + int n; + int *a = new int[n]; +public : + + arr(); + + arr(int in); + + arr(const arr& arr2); + + arr::arr(const arr & obj); + + ~arr(); + + int getSize(); + + void readElement(); + + double calculateAverage(int a[], int n); + + int getElement(int array[], int n, int x); + + void print(); + + arr operator+(arr a2); + arr operator-(arr a2); + arr operator/(arr a2); + arr operator*(arr a2); + int &operator[] (int indux); + arr operator+=(arr b2); + arr operator-=(arr b2); + arr operator/=(arr b2); + arr operator*=(arr b2); + arr operator-(); + + friend istream &operator>>(istream& input, arr& a) { + + input >> a.n; + return input; + } + friend ostream &operator<<(ostream&output, arr& a) { + + output << a.n; + + return output; + + } + +}; + #endif