Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PROGRAM MUST BE WRITTEN IN C AND COMPILED IN DEV-C++ nctionality Specification 1. Add donations and requests to the tables. 2. For any new donation

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

PROGRAM MUST BE WRITTEN IN C AND COMPILED IN DEV-C++

nctionality Specification 1. Add donations and requests to the tables. 2. For any new donation that comes in, check if any donation is present in the donations table with same inventory type; if there is one then increase its amount by the new donation amount, and do not add a new entry in the donations table. If not, then add a new entry in the donations table for that donation. Remove a request from the request table when it is fulfilled. If for a request the request amount is greater than the amount present, then partially fulfill that request by the amount present. And do not delete that request from the request table; just reduce its amount by the amount that is fulfilled. 3. 4. 5. If in the process of fulfilling the request, the amount present for any donation becomes 6. Print the status report, containing stock currently available and requests that are not yet 7. When the option is to Fulfill a Request, you are to only process the one request that is at zero, then remove that donation from the donations table fulfilled. the top of the Request Table (the oldest request). Thus, if it cannot be fulfilled, it will stall the system, until someone donates enough, so it can be satisfied later Input/Output Specification At the beginning, the program should present the user with the available options, and ask for The user will have five choices: 1. Enter a Donation 2. Enter a Request 3. Fulfill the earliest Request 4. Print status report 5. Exit When the user selects ', the program should ask the user for the inventory type and amount of the donation to be made. When the donation has been added to the donations table, the program should notify the user by printing out "Donation Added". Implementation Hints If we assume that the maximum number of donated types at any time is 100, and that the Maximum length of a description of the type is 19, then, our tables can be declared as: char donations_inv_type[100][20]; int donations_amount[100]; You will need to have variables to keep track (count) of the total donated types, and total requests, in the two tables. Use function 'stremp' to compare if two strings are equal. Remember that when the two string:s are equal this function returns 0 Use function 'strepy' to copy from one string variable to another. Donation Added! Press any key to continue .. . Welcome to the Food Bank Program 1. Add a donation 2. Add a request 3. Fulfill a request 4. Print status report 5. Exit Enter your choice:_4 Printing the Donations Table MILK 25 FRUIT 10 Printing the Requests Table Welcome to the Food Bank Program 1. Add a donation 2. Add a request 3. Fulfill a request 4. Print status report 5. Exit Enter your choice:_4 Printing the Donations Table MILK 20 FRUIT 10 Printing the Requests Table Press any key to continue .. . Welcome to the Food Bank Program 1. Add a donation 2. Add a request 3. Fulfill a request 4. Print status report 5. Exit

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

Deductive And Object Oriented Databases Second International Conference Dood 91 Munich Germany December 18 1991 Proceedings Lncs 566

Authors: Claude Delobel ,Michael Kifer ,Yoshifumi Masunaga

1st Edition

3540550151, 978-3540550150

More Books

Students also viewed these Databases questions

Question

What are the major global trends your industry faces?

Answered: 1 week ago