Home › Forums › C Programming › I really need your help!!!
- This topic has 1 reply, 2 voices, and was last updated 17 years ago by denco.
Viewing 1 reply thread
- AuthorPosts
- November 19, 2007 at 5:25 am #2034sonyParticipant
Hi all. I’m a beginner to C. And I am writing a program which updates a billing system. I just need any of you to help me check the coding I have made. And I do not have C software on this computer, so I have to do it in college. Please, my dateline is coming. This is the coding…. I would totally appreciate it if you do help me.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677<br /><br />#include <stdio.h><br />void readinput(int i)<br />void writeoutput(int i)<br /><br />main()<br />{<br />struct date{<br />int month;<br />int day;<br />int year;<br />};<br />struct account<br />{<br />char name[80];<br />char street[80];<br />char city[80];<br />int acct_no;<br />float previous_balance;<br />float current_payment;<br />float new_balance;<br />struct date lastpayment;<br />}<br />customer[];<br />int i,n;<br />printf("CUSTOMER BILLING SYSTEMnn");<br />printf("How many customer are there?");<br />scanf("%d",&n);<br /><br />for(i=0;i<n;++i)<br />{<br />readinput(i);<br />customer[ i ].new_balance=customer[ i ].previous_balance - customer[ i ]current_payment;<br />};<br /><br />for(i=0;i<n;++i)<br /><br />writeoutput(i);<br />}<br />void readinput(int i)<br />{<br />printf("Customer no.%dn",i+1);<br /><br />printf(" Name:");<br />scanf("%[^n]",customer[ i ].name);<br />printf(" Street:");<br />scanf("%[^n]",customer[ i ].street);<br /><br />printf(" City:");<br />scanf("%[^n]",customer[ i ].city);<br /><br />printf(" Account number:");<br />scanf("%d",&customer[ i ].acct_no);<br /><br />printf(" Current payment:");<br />scanf("%f",&customer[ i ].currentpayment);<br /><br />printf(" Payment date (mm/dd/yyyy):");<br />scanf("%d%d%d",&customer[ i ].lastpayment.month,&customer[ i ].lastpayment.day,&customer[ i ].lastpayment.year);,<br /><br />return;<br />}<br /><br />void writeoutput(int i);<br />{<br />printf("nName: %s",customer[ i ].name);<br />printf(" Account number:%dn",customer[ i ].acct_no);<br />printf("Street: %sn",customer[ i ].street);<br />printf("City %snn",customer[ i ].city);<br />printf("Previous Balance: %7.2f",customer[ i ].previousbalance);<br />printf(" Current Payment: %7.2f", customer[ i ].currentpayment;<br />printf(" New balance: %7.2fnn",customer[ i ].newbalance);<br />return;<br />}<br /><br /> - December 1, 2007 at 3:53 am #3280dencoParticipant
oh dear its too long no!
its ok what i thought was ur programme is correct
- AuthorPosts
Viewing 1 reply thread
- The forum ‘C Programming’ is closed to new topics and replies.