title: deposit() function of this checking account C program
body: <p>I am writing a program in C to simulate a checking account. There are codes for transactions, I = Initial Balance, D = Deposit, and C = Check(you write a check to someone, like a withdrawal). There is a monthly fee of $3.00 to maintain the account, $0.06 fee for every check cashed, %0.03 for every deposit made, $5.00 overdraft fee whenever a check cashed brings the balance below $0.00.</p>
  
  <p>I am having trouble completing the functions. If you don't think helping a bit with all of them is ok then please just help with the deposit() function. I am only a couple months into C and we just got into functions. Here is my unfinished code. Thanks for any help.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void outputHeaders (void);
  void initialBalance (double iBalance);
  void deposit(double amount, double balance, double service, int numDeposit,double amtDeposit);
  void check(char code, double amtCheck, double balance);
  void outputSummary ();
  
  
  int main (void)
  {
  
  char code;
  double amount, service, balance;
  double amtCheck, amtDeposit, openBalance, closeBalance;
  int numCheck, numDeposit;
  
  amount       = 0.0;
  service      = 0.0;
  balance      = 0.0;
  amtCheck     = 0.0;
  amtDeposit   = 0.0;
  openBalance  = 0.0;
  closeBalance = 0.0;
  numCheck     = 0;
  numDeposit   = 0;
  
  outputHeaders();
  
  printf("Enter the code of transaction and the amount: ");
  scanf("%c %lf\n", &amp;code, &amp;amount);
  
  if (code == 'I')
  {
      initialBalance(amount, &amp;balance, &amp;service, &amp;numDeposit, &amp;amtDeposit);
  }
  
  else if (code == 'D')
  {
      deposit (amount, &amp;balance, &amp;service, &amp;numDeposit);  
  }
  else
  {
      check(amount, &amp;balance, &amp;service, &amp;numCheck, &amp;amtCheck);
  }
  
  
  getchar(); getchar();
  return 0;
  }
  
  void outputHeaders (void)
  {
  
  printf("Transaction         Deposit       Check      Balance\n"
         "--------------      --------      ------     -------");
  }
  
  void initialBalance (double amount, double *balance, double *service, int *numDeposit, double *amtDeposit)
  {
  
  
  
  }
  
  void deposit (double amount, double *balance, double *service, int *numDeposit, double *amtDeposit)
  {
  
  *balance = *balance + *amtDeposit;  
  *numDeposit++;                      //need to keep track of amount of deposits
  *service = *service - 0.03;         //service charge
  
  printf("Deposit %lf %lf\n", *amtDeposit, *balance);
  
  }
  
  void check (double amount, double *balance, double *service, int *numCheck, double *amtCheck)
  {
  
  
  
  }
  
  void outputSummary (int *numDeposit, double *amtDeposit, int *numCheck, int *amtCheck, double *openBalance, double *service, double *closeBalance)
  {
  
  
  
  }
  </code></pre>