Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in c programming language . i also included my code . im getting errors on line 35 . #include #include int main() { int masterAccount;
in c programming language . i also included my code . im getting errors on line 35 .
#include
#include
int main()
{
int masterAccount;
int transacAccount;
double masterBalance;
double transacBalance;
char masterName [30];
FILE *odfptr;
FILE *trfptr;
odfptr=fopen("oldmaster.dat","w" );
trfptr=fopen("transact.dat","w");
printf("sample data for oldmaster.dat: ");
int x ;
do
{
printf(" enter account , name , balance :");
scanf("%d%[^0-9-]% lf",&masterAccount, masterName,&masterBalance);
fprintf(odfptr,"%d %s %.2f ",masterAccount,masterName,masterBalance );
printf(" do you want to add another account? ");
printf(" 1. yes ");
printf(" 0. no ");
getchar();
scanf( " %d ", &x );
} while (x!=0);
fclose(odfptr);
printf (" sample data for transact.dat: ");
int c ;
do
{
printf("enter account and transact amount:");
scanf( " %d %lf", &transacAccount, &transacBalance );
fprintf(trfptr,"%d %.2f ", transacAccount,transacBalance );
printf( " Do you want to add more transactions ? ");
printf(" 1. yes ");
printf(" 0. no ");
getchar();
scanf( " %d ", &c );
}
while (c!=0);
fclose (trfptr);
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started