|
@ -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); |
|
|
} |
|
|
} |