Hospitals use programmable pumps to deliver medications and fluids to intravenou
ID: 3645689 • Letter: H
Question
Hospitals use programmable pumps to deliver medications and fluids to intravenous lines at a set number of milliliters per hour . Write a program to output information for the labels the hospitals pharmacy places on bags of I.V. medications indicating the volume of medication to be infused and the rate at which the pump should be set. The program should prompt the user to enter the quantity of fluid in the bag and the number of minutes over which it should be infused . Output the VTBI ( volume to be infused )in ml and the infusion rate in ml/hrsample run :
volume to be infused (ml) => 100
minutes over which to infuse => 20
VTBI : 100 ml
rate : 300 ml/hr
Explanation / Answer
001 #include 002 using namespace std; 003 004 class GasPump 005 { 006 public: 007 void initialize(); // set charges, amount dispensed, and 008 //gasInMainTank to 0. 009 void reset(); // set charges and amount dispensed to 0; 010 void displayCostPerGallon(); 011 //If there is only one grade, of gasoline, this should be a static 012 //member of GasPump, since it would then apply to all instances of 013 //GasPump. If there are several grades, then this and costPerGallon 014 //should be ordinary members. 015 016 void displayGasNCharges(); 017 // Dispense member continually updates display of new amount and 018 // new charges 019 void dispense(); 020 void stop(); // If called, stops dispensing operation. 021 // My implementation never used this. 022 023 private: 024 double gasDispensed; 025 double charge; 026 027 public: 028 029 void setPricePerGallon(double newPrice); 030 void buyFromJobber(double quantity); 031 void displayAmountInMainTank(); 032 033 private: 034 035 double gasInMainTank; 036 double costPerGallon; 037 }; 038 039 void GasPump::displayAmountInMainTank() 040 { 041 coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.