Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write two functions, which read/write an array of records to/from a file. Write driver code to test the two functions. The driver code and the

image text in transcribed

Write two functions, which read/write an array of records to/from a file. Write driver code to test the two functions. The driver code and the test output must show clearly that the file input and output work correctly Requirements 1. Definition of Record Create a header file, record.h, containing the following definition. Note that the structure is different from the one used in the previous assignments. struct record accountno; name [251: address[BO]; char char 2. Read/Write Functions Create a source file, iofunctions.c, containing the following functions. int readfile( struct record accarray , int numcust, char filename[ ; int writefile struct record accarrayl , int numcust, char filename Basic s o The function, readfile, will read the data from a text file and store it in the array specified by accarray It must tell the function which called it how many records it has stored into the array. o The function, writefile, will write the data stored in the array specified by accarray into a text file o The return values will be used to tell whether the functions successfully read/write data. o The size of the array and the name of the text file are assumed to be arbitrary (You cannot specify them in this file) o The functions must not have user VO (printf, scanf, etc). 3. Driver Code o Define the following local variables in the main function struct record bankone [5] int numcustomers; A menu is not required. The user-interface can be very simple, but the output of the program must be clear and self-explanatory and must be definitive proof that the functions work. o o You may get input from the keyboard or hardcode your array in the driver for testing o Please make sure that your test cases can really prove that the functions work. (Check if your test case could provide the same results even if they dont work.) The driver code must be written in different c file(s) rather than iofunctions.c o

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

Question What is a Roth 403 (b) plan?

Answered: 1 week ago

Question

Question Can a Keogh plan fund be reached by the owners creditors?

Answered: 1 week ago