From 8b185a3cdcc14b64f25a7577db3d993bd2acd63c Mon Sep 17 00:00:00 2001 From: fdai7472 Date: Mon, 29 Jan 2024 15:48:06 +0100 Subject: [PATCH] getBalance() added --- src/main/c/Stefan/slot_machine.c | 8 ++++++++ src/main/c/Stefan/slot_machine.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/main/c/Stefan/slot_machine.c b/src/main/c/Stefan/slot_machine.c index b5ad747..f0ee169 100644 --- a/src/main/c/Stefan/slot_machine.c +++ b/src/main/c/Stefan/slot_machine.c @@ -5,12 +5,20 @@ void slotMachine(){ welcomeMessage(); + int balance = getBalance(); +} + +int getBalance(){ + int balance; + printf("Guthaben einwerfen: "); + scanf_s("%d", &balance); + return balance; } void welcomeMessage(){ diff --git a/src/main/c/Stefan/slot_machine.h b/src/main/c/Stefan/slot_machine.h index 588b6ea..3da8ff8 100644 --- a/src/main/c/Stefan/slot_machine.h +++ b/src/main/c/Stefan/slot_machine.h @@ -3,5 +3,7 @@ void slotMachine(); void welcomeMessage(); +int getBalance(); + #endif // SLOT_MACHINE_H \ No newline at end of file