Code:
#include<stdio.h>
void printr(float,float,float,float, float, float, float, char, char, char);
void main(void)
{
float b1,b2,b3, bal, tran, with, dep, bill, amount;
char junk, ans;
char date[15],withdate, depdate, billdate;
printf("Please type the last balance as float\n");
scanf("%f", &bal);
scanf("%c",&junk);
printf("Transactions\n");
printf("Please type Y to continue or N if you want to stop\n");
scanf("%c", &ans);
while(ans=='Y')
{
printf("Please type the date as one string\n");
scanf("%s", &date);
printf("Next type transtype as integer and amount as float\n");
scanf("%d%f", &tran, &amount);
if(tran=1)
{
bal=bal-amount;
with=amount;
withdate=date;
}
else if(tran=2)
{
bal=bal+amount;
dep=amount;
depdate=date;
}
else
{
billdate=date;
bal-=amount;
bill=amount;
}
scanf("%c",&junk);
printf("Please type Y to continue or N if you want to stop\n");
scanf("%c", &ans);
}
b3=bal;
b2=b1+dep;
b1=6000-with;
printr(with, dep, bill, bal, b3, b2, b1, withdate[15], depdate[15], billdate[15]);
}
void printr(float with, float dep, float bill, float bal, float b3, float b2, float b1, char withdate[], char depdate[], char billdate[])
{
printf("Date \t type \t amount \t balance\n");
printf("%c \t wd \t %f \t %f\n", withdate, with, b1);
printf("%c \t wd \t %f \t %f\n", depdate, dep, b2);
printf("%c \t wd \t %f \t %f\n", billdate, bill, b3);
}
but once again I get some of the same errors i got last time and i really don't see what they are talking about. These are the new errors, a little less than before