Question: Write a menu - driven C + + program that helps a recycling company keeps records on providers of waste paper products in the following
Write a menudriven C program that helps a recycling company keeps records on providers of waste paper products in the following form:
ID integer
Name string
Current Year Amount Paid CYAP double or float
Amount Due double or float
Your program should first data from a file named paper.dat for a set of records and places these records into a binary search tree using ID as the search key, as it is unique for each provider. Each data item in the file will appear on a separate line, and the names may contain white spaces. There is a blank line between records. Your program should then display a menu with the following options:
Add a record
Issue a payment
Accept a delivery
Print Summary Report
Exit
Implement each option as described below:
ADD A RECORD Accept the ID Number and Name of a new provider and add a new record to the list. Set the Amount Paid and Amount Due to zero.
ISSUE A PAYMENT Accept an ID Number and print the Amount Due for that ID Number. Then accept from the user a payment amount, which is less than or equal to the amount due. Update Current yearly amount paid and Amount Due accordingly and print the uptodate amount due. Print an error message if a record with that ID Number is not on the list.
ACCEPT A DELIVERY Accept an ID Number and a dollar amount for the amount of paper delivered. Add this dollar amount to the Amount Due and print an uptodate Amount Due. Print an error message if a record with that ID Number is not on the list.
PRINT SUMMARY REPORT Print a report with one set of headings that shows all information on the list.
EXIT print the list of records to an output file named paper.out and terminate the program. The output file should have the same format as the input file.
Program should return to the main menu after performing each operation.
Sample IO
Sample input and output files as well as an executable have been placed in the class folder.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
