diff --git a/CM2005 Object Oriented Programming/Topic 1/1.7.1/a.exe b/CM2005 Object Oriented Programming/Topic 1/1.7.1/a.exe new file mode 100644 index 0000000..712e017 Binary files /dev/null and b/CM2005 Object Oriented Programming/Topic 1/1.7.1/a.exe differ diff --git a/CM2005 Object Oriented Programming/Topic 1/1.7.1/main.cpp b/CM2005 Object Oriented Programming/Topic 1/1.7.1/main.cpp new file mode 100644 index 0000000..ecdd45d --- /dev/null +++ b/CM2005 Object Oriented Programming/Topic 1/1.7.1/main.cpp @@ -0,0 +1,26 @@ +#include + +int difference(int a, int b); + +void printHello() +{ + std::cout << "Hello" << std::endl; +} + +/** compute the average of x and y**/ +float average(float x, float y) +{ + float sum; + sum = x+y; + return (x+y)/2; +} + +int main() +{ + printHello(); + float a = average(15, 23); + std::cout << a << std::endl; + int c = difference(10, 7); + std::cout << c << std::endl; + return 0; +} \ No newline at end of file diff --git a/CM2005 Object Oriented Programming/Topic 1/1.7.1/side.cpp b/CM2005 Object Oriented Programming/Topic 1/1.7.1/side.cpp new file mode 100644 index 0000000..7e7008e --- /dev/null +++ b/CM2005 Object Oriented Programming/Topic 1/1.7.1/side.cpp @@ -0,0 +1,6 @@ +#include + +int difference(int a, int b) +{ + return a-b; +} \ No newline at end of file