I am having problems completing this program. I have included my notes, and stated current problems in the beginning.
Please help. I have no idea what I am doing. This is all I have accomplished in 4 days! I am new to programming, well relatively, it was nearly 17 years ago last time I wrote any code.
/*Current Problems which need to be fixed:
After aasking for the account number it requires you to enter the account number 2 times.
Then prints the menu 2 times.
Then does not give the option of choosing menu options.*/
/* Basic Accounting Program for beginners:
Input debits (DB) and credits (CR) and allow for 1,000,000 DB and CR transactions.
Start accounts with a zero balance.
Do not allow account balance to go below 0.
At the end of 31 days, print out account number and balances for 25 different accounts.*/
#include <stdio.h>
#define DAY 31
int main(void)
{
printf("Basic Accounting Program\n");
int acct = 0;
int count, factorial;
int choice = 0;
for (count = 1; count < DAY ; count++)
{
printf ("Day %d\n",count);
printf ("Input account numbers only, if anything else the program will exit, thank you!\n");
scanf ("%d\n", &acct);
/*?why will it not proceed to next step without entering the account number 2 times?*/
printf ("\Please choose an option below\n");
printf ("\t1. Credit\n");
printf ("\t2. Debit\n");
printf ("Please enter your choice: \n");
/*?Prints menu (at this point 2 times) then the program stops, why will it not go to my if else statements?*/
if (choice = 1)
printf ("Input CR\n");
else if (choice = 2)
printf ("Input DB\n");
else if (choice != 1, 2)
printf ("\Please choose an option below\n");
printf ("\t1. Credit\n");
printf ("\t2. Debit\n");
printf ("Please enter your choice: \n");
break;
}
/*do sum of 31 days here*/
return 0;
}