From ecc80681035e7c615500538b1aa28b53bd3b8ce8 Mon Sep 17 00:00:00 2001 From: fdai7057 Date: Sun, 22 Jan 2023 10:01:41 +0100 Subject: [PATCH] Implementation of function error() --- build-project.sh | 5 ----- src/Error.c | 23 +++++++++++++++++++++++ src/Error.h | 2 ++ src/main.c | 7 ------- team.md | 9 --------- 5 files changed, 25 insertions(+), 21 deletions(-) delete mode 100755 build-project.sh create mode 100644 src/Error.c create mode 100644 src/Error.h delete mode 100644 src/main.c delete mode 100644 team.md diff --git a/build-project.sh b/build-project.sh deleted file mode 100755 index fbd6ce9..0000000 --- a/build-project.sh +++ /dev/null @@ -1,5 +0,0 @@ -clear -cd src/ -gcc main.c -./a.out -rm a.out diff --git a/src/Error.c b/src/Error.c new file mode 100644 index 0000000..ba552a2 --- /dev/null +++ b/src/Error.c @@ -0,0 +1,23 @@ +#include "Error.h" + +int error(int errorCode) +{ + int returnValue=0; + switch(errorCode){ + case -1: + puts("Login not successful."); + returnValue = -1; + break; + case -2: + puts("Maximum number of attempts reached."); + returnValue = -2; + break; + case -3: + puts("No menu entry available for this number."); + returnValue = -3; + break; + default: + puts("Error code unknown."); + } + return returnValue; +} diff --git a/src/Error.h b/src/Error.h new file mode 100644 index 0000000..5e83c4d --- /dev/null +++ b/src/Error.h @@ -0,0 +1,2 @@ +#include +int error(int); diff --git a/src/main.c b/src/main.c deleted file mode 100644 index 2e0147f..0000000 --- a/src/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main() -{ - - return 0; -} diff --git a/team.md b/team.md deleted file mode 100644 index 02580e9..0000000 --- a/team.md +++ /dev/null @@ -1,9 +0,0 @@ -# Bankmanagement-System - -- Can Hacioglu, Fdlt3817 -- Atharva Kishor Naik, fdai7514 -- Julius Philipp Engel, fdai7057 -- Shivam Chaudhary, fdlt3781 -- Mohamed Yahya Dahi, fdai6618 -- Haytham Daoula, fdai7207 -