Heres what i need to do!!

A. Create a structure, called creditcard that contains three members: credit_card_number (integer data type), authorization_number (integer data type) and amount_to_charge (float data type):

B. Create an array called records, which contains 50 creditcard structures.

C. Using three lines of code, initialize the data for records[25] to: credit_card_number = 4111111, authorization_number=56222 and amount_to_charge = 29.95.

D. Create a pointer to creditcard and call it cardPtr. Initialize cardPtr to point to the zeroeth element of the records array.

E. Using cardPtr defined above, initialize the data for records[0] to: credit_card_number=599121, authorization_number = 89333 and amount_to_charge = 49.95.

F. Using cardPtr, print out all data contained in records[25].


Heres what i have, please help!! i ran the program, it compiles and runs fine, but the problem is, it prints out two lines of text saying only credit card number, and give random numbers each time the program is run.

Code:


int main( void )
        { 
           int acctNum;     /* acctNum number */
           char lastName[ 15 ]; // account last name //
           char firstName[ 10 ]; // account first name //
           int userID;       // account user ID //
           double balance;  /* acctNum balance */
        
           FILE *cfPtr;     /* cfPtr = clients.dat file pointer */
        
           /* fopen opens file; exits program if file cannot be opened */ 
           if ( ( cfPtr = fopen( "account.txt", "r" ) ) == NULL ) {
              printf( "File could not be opened\n" );
           } /* end if */
 else { /* read acctNum, lastName, firstName, userID, & balance from file */
              printf( "%-10s%-10s%-12s%-9s%s\n", "Account", "LastName", "FirstName", "UserID", "Balance" );
              fscanf( cfPtr,"%d%s%s%d%lf", &acctNum, lastName, firstName, &userID, &balance );
                  /* while not end of file */
              while ( !feof( cfPtr ) ) { 
                 printf( "%-10d%-10s%-12s%-9s%7.2f\n", acctNum, lastName, firstName, userID, balance );
                 fscanf( cfPtr, "%d%s%s%d%lf", &acctNum, lastName, firstName, &userID, &balance );
                    } /* end while */
        
              fclose( cfPtr ); /* fclose closes the file */
             } /* end else */
        
           return 0; /* indicates successful termination */
        
        } /* end main */