Coders Packet

Efficient Oxygen Distribution to Covid Patients in C++

By Soumak Poddar

In this project, we will learn how can we efficiently distribute Oxygen Cylinders from a factory to all districts of a state efficiently according to their requirements in C++.

In this project, we will consider we have an Oxygen Generation plant that produces oxygen for the whole state and stores oxygen for supplying to all the state's districts. In this project, we will be given the requirements of all the districts of a state and what we have to do is we have to distribute all the oxygen from the plant to all the states according to their needs ie. if any state requires more amount of oxygen cylinders then it should be allocated the most percentage of cylinders from the factory.

Our algorithm basically finds the percentage of oxygen cylinders needed by a district and distributes that percent of oxygen cylinders of the total available to each state.

What the user inputs are the total number of oxygen cylinders available in the plant in the first line, the number of districts in the second line, and the name and the requirements of the districts in the next lines.

The input and output of our code is:-

Image

I have attached the code as a zip file.

Download project

Reviews Report

Submitted by Soumak Poddar (soumakpoddar)

Download packets of source code on Coders Packet