Green Keepers, Inc. is a lawn mowing service that operates primarily in the summer months. The owner has requested a program to help maintain service information about the clients.
For this the first phase of the implementation, the following transactions will be needed:
The output report will consist of 3 sections:
1.The program must include the required documentation (Identification Header, Problem Specification, Problem Analysis) and follow programming documentation guidelines (see A#2). Before each function definition include documentation as shown in A#5:
2.Input is from the ASCII text files Lawn.data and Trans.data. Output is to Report.out. See input file specifications below.
3.The input data must be read until end of file is reached from Lawn.data and stored into a 1-D array of CLIENT structures. The CLIENT declaration must contain a nested (hierarchical) 1-D array structure of type HISTORY for describing a clients service history.
Thereafter, all processing including the report printing must be done against the partially-filled array of CLIENT structures. Only read Lawn.data until end-of-file is reached 1 time! There is a maximum of 30 clients; there is a maximum of 10 histories per client.
4.The records from the file, Trans.data, should be read and processed against the 1-D array of CLIENT structures one after another until end of file is reached in Trans.data. As each transaction is processed, a log of the work is printed in Section 2 of the output report.
5.Use a ragged array to print the description for the client service provided and not the code:
1 = “Full Service”
2 = “Basic”
3 = “Economy”
Usage:
string serviceDescription[] = {DUMMY, Full Service, Basic, Economy};
6.The ordered linear search should be used to locate a client in the CLIENT array using the transaction ID.
7.The file Report.out should be created from the array and contains 3 sections:
Section 1 - a report showing all client data for all clients before transactions are applied
Section 2 - a report describing all transactions as they are being applied against the 1-D client array:
If a transaction code is invalid (not C, not A and not V),
Print the transaction code, Print an error message,
Flush the transaction input line to ‘n’.
If no match for an ID is made,
Print the transaction code (‘C’, ‘A’, ‘V’)
Print the invalid client ID with a suitable error message.
For all other valid transactions,
Print the transaction Code,
Print the client ID and client Name, Print the before and after values.
For, transaction ‘A’, add 1 to the current year’s history service counts.
Section 3 - a report showing all client data for all clients after the transactions
8. Just before the program ends, open LawnNEW.data for output and create the new data file version from the updated 1-D array of CLIENT structures.
Input File: ASCII text file named Lawn.data, stored in ascending order by the client ID in the following format for each client. Client history at (number of histories 1) is the current (most recent) history. see image.
IMPORANT NOTE: the most recent history is at position, Number of Histories -1. In other words the oldest history for a client is at the beginning of the history array for a client.
Input File: ASCII text Trans.data, transactions in any order, fields separated by spaces according to the following formats: see image.
Output File: ASCII text file Report.out, Use good sub-report layout with nice heading, column headings, and formatting. BE SURE AND INCLUDE THE COMPANY NAME IN THE HEADING!