52 lines
1.4 KiB
C
52 lines
1.4 KiB
C
#ifndef ATMFUNCTIONS_H
|
|
#define ATMFUNCTIONS_H
|
|
|
|
/**
|
|
* @brief The entrypoint of the program, displays an interactive menu to the
|
|
* user and executes the correct action.
|
|
*
|
|
*/
|
|
void start_atm();
|
|
|
|
/**
|
|
* @brief Prints the ATM menu to the user, with options to print balance,
|
|
* deposit, withdraw, or quit.
|
|
*
|
|
*/
|
|
void print_menu();
|
|
|
|
/**
|
|
* @brief Prompts the user for a character, and returns it
|
|
*
|
|
* @return char The user-inputted character
|
|
*/
|
|
char get_user_selection();
|
|
|
|
/**
|
|
* @brief Prints the current balance of the user formatted appropriately ($X.XX
|
|
* format).
|
|
*
|
|
* @param dollars The amount of full dollars the user currently has
|
|
* @param cents The amount of cents the user currently has
|
|
*/
|
|
void print_balance(int *pDollars, int *pCents);
|
|
|
|
/**
|
|
* @brief Prompts the user an amount to deposit, validates it, and modifies the
|
|
* user's money amount appropriately.
|
|
*
|
|
* @param dollars The amount of full dollars the user currently has
|
|
* @param cents The amount of cents the user currently has
|
|
*/
|
|
void deposit_money(int *pDollars, int *pCents);
|
|
|
|
/**
|
|
* @brief Prompts the user an amount to withdraw, validates it, and modifies the
|
|
* user's money amount appropriately.
|
|
*
|
|
* @param dollars The amount of full dollars the user currently has
|
|
* @param cents The amount of cents the user currently has
|
|
*/
|
|
void withdraw_money(int *pDollars, int *pCents);
|
|
|
|
#endif // ATMFUNCTIONS_H
|