Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Liquid Dl is a water company that trucks water to 20 residents in Wasp Hill district in Africa. There are 4 roads in the entire

Liquid Dl is a water company that trucks water to 20 residents in Wasp Hill district in Africa. There are 4 roads in the entire community and 5 household on each road to truck water to. A single water truck services the entire community. Use four arrays to store the gallons given to each road. road1Gallons[5], road2Gallons[5], road3Gallons[5], road4Gallons[5].

Write a C program that accepts the starting number of gallons of water placed in the truck. The starting quantity is evenly distributed amongst the four roads but not evenly distributed amongst individual household.

Each household makes a request for the water from the trucking system , the system checks if the truck has enough water for that road and output to user if they are able to get the gallons requested . Output a message if the resident needs to make a lower request.

After each household is given water. A message is reported of the remaining gallons for that road.

Place the number of gallons given to each household on a particular road and store it in an array.

Track the total number of gallons given to each road. Also track the total gallons given to the entire Wasp hill District.

At the end of the day state the totals gallons remaining in the entire truck

Report the average gallons used by household per road

Find the household that uses the highest number of gallons per road

Allow the program to record and report about all 4 roads at any one execution of the program.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Managerial Accounting Tools for business decision making

Authors: Jerry J. Weygandt, Paul D. Kimmel, Donald E. Kieso

5th edition

470506954, 471345881, 978-0470506950, 9780471345886, 978-0470477144

Students also viewed these Databases questions