Browse Source

Logic fundamentals and placeholder code

remotes/origin/feature/deposit-system
fdlt3817 2 years ago
parent
commit
bca3ba8c0c
  1. 3
      src/.vscode/c_cpp_properties.json
  2. BIN
      src/a.exe
  3. 27
      src/depositMoney.c
  4. 2
      src/depositMoney.h

3
src/.vscode/c_cpp_properties.json

@ -3,8 +3,7 @@
{ {
"name": "Win32", "name": "Win32",
"includePath": [ "includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/"
"${workspaceFolder}/**"
], ],
"defines": [ "defines": [
"_DEBUG", "_DEBUG",

BIN
src/a.exe

27
src/depositMoney.c

@ -1,13 +1,32 @@
#include <depositMoney.h>
#include "depositMoney.h"
int InitiateDepositMoney(float amountToDeposit, float availableAccountBalance){ //type of int to return possible end cases.
int InitiateDepositMoney(float amountToDeposit, float availableAccountBalance){ //type of int to return possible end cases.
return 1;
} }
int DepositMoney(){ int DepositMoney(){
//TODO: Set a minimum deposit amount.
float amountToDeposit;
float availableAccountBalance = 10000; //for testing purposes. will be replaced with an actual function to retrieve this data.
printf("Please enter the amount to deposit: ");
scanf("%f", &amountToDeposit);
if(amountToDeposit>0){
//InitiateDepositMoney(amountToDeposit,availableAccountBalance);
printf("You have successfully deposited %f. New account balance is %f", amountToDeposit, availableAccountBalance+amountToDeposit);
return 0;
}else{
return 1; //invalid input
}
}
int main()
{
char any;
DepositMoney();
scanf("%c", &any);
} }

2
src/depositMoney.h

@ -1,4 +1,4 @@
#include <stdio.h> #include <stdio.h>
#include <conio.h>
int InitiateDepositMoney(float amountToDeposit, float availableAccountBalance); int InitiateDepositMoney(float amountToDeposit, float availableAccountBalance);
int DepositMoney(); int DepositMoney();
Loading…
Cancel
Save