Exam 2 program

Exam 2 program - Script started on Wed Mar 30 17:11:19 2005...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Script started on Wed Mar 30 17:11:19 2005 %cat c53e2r.c #include<stdio.h> void typea(int checks, double balance,double *charge_bef,double *discount); void typeb (int checks,double balance,double *charge_bef,double *discount); void typec (int checks,double balance,double *charge_bef,double *discount); void findmax (double tot_typea,double tot_typeb,double tot_typec, double *max,char *max_type); int main (void){ int checks,id,count,flag; char type_acct,max_type; double charge_bef,discount,net_charge,grandtot_charge,tot_typea, tot_typeb,tot_typec,balance,max_amt,tot; FILE *infile; FILE *outfile; infile=fopen("test.input","r"); outfile=fopen("test.output","w"); fprintf(outfile," Id type Number Savings Account"); fprintf(outfile," Pre-discount Discount Net \n"); fprintf(outfile,"Number Account Checks Balance"); fprintf(outfile," Charge Amount Charge\n"); count=0; tot_typea=tot_typeb=tot_typec=0.0; flag=fscanf(infile,"%d",&id); while (flag != EOF){ fscanf(infile," %c %d %lf",&type_acct,&checks,&balance);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/01/2011 for the course CSC 1253 taught by Professor Staff during the Fall '08 term at LSU.

Page1 / 3

Exam 2 program - Script started on Wed Mar 30 17:11:19 2005...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online