Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I saw the \"answer\" already posted in textbook solutions but the code doesnt ma

ID: 3818556 • Letter: I

Question

I saw the "answer" already posted in textbook solutions but the code doesnt make sense to me. Also, I think it would be easier if you can use a Switch statement for this problem.

It's question number 2 - It's talking about a hospital supplies etc.

thank you so much for your help.

366 Chapter 6 Pointers and Modular Programming double goofy, char greedy) happy int char grumpy 5. Sketch the data areas of functions main and silly as they appear imme. diately the return from the first call to silly in Exercise 8 6. Present against these statements: a program written with a. is foolish to use function because written without functions has many more lines than the same program b. functions subprograms leads to more errors because of The use of function in using argument lists Programming Projects 1. an teller machine that dispenses mone the The user should enter the amount desired (a multiple of 10 dollars) and machine dispenses this amount using the least number of bills. The bills pensed are 50s, 20s, and 10s. Write a function that determines how many of each kind of bill to dispense. 2. A hospital supply company wants to market a program to assist with the cal culation of intravenous rates. Design and implement a program that interact with the user as follows: INTRAVENOUS RATE ASSISTANT Enter the number of the problem you wish to solve. GIVEN A MEDICAL ORDER IN CALCULATE RATE IN (1) ml/hr & tubing drop factor drops min (2) 1 L for n hr ml hr 3) mg/kg/hr & concentration in mg/ml ml hr (4) units/hr & concentration in units/ml ml hr 5) QUIT Problem> 1. Enter rate in ml/hr 150 Enter tubing's drop factor (drops/ml) 15 The drop rate per minute is 38.

Explanation / Answer

#include<iostream>
using namespace std;
void get_problem();
int get_rate_drop_factor(int,int);
int get_kg_rate_conc(int);
int get_units_conc(int);
int fig_drops_min(int,int);
int fig_ml_hr(int);
int by_weight(int, int,int);
int by_units(int,int);


int main()
{
int choice;
int rm,dr,rpm;
int h,mh;
  
  
cout<<"INTRAVENOUS RATE ASSESSMENT"<<endl;
  
  
do
{
get_problem();
cin>>choice ;
switch (choice)
{
case 1 :
   cout<<" Enter rate in ml/hr =>";
   cin>>rm;
   cout<<" Enter tubing's drop factor(drops/ml) =>";
   cin>>dr;
   rpm=get_rate_drop_factor(rm,dr);
   cout<<" The drop rate per minute is "<<rpm;
  
  
           break;

case 2 :
  
   cout<<" Enter no of hours =>";
   cin>>h;
   mh=fig_ml_hr(h);
  
   cout<<" The rate in mm per hour=>"<<mh;
          
           break;
  
case 3 : // define methods and call methods
break;
case 4 : // define methods and call methods
           break;
  
case 5:
exit(0) ;
}
}while(2);
  
  
  
  

  
  
  
  
return 0;
}


void get_problem()
   {
       cout<<" Enter the number of the problem you wish to solve.";
       cout<<" Given a Medical Order In Calculate Rate In ";
   cout<<" 1 ml/hr & tubing drop water drops/min ";
cout<<" 2. 1 L for n hour ml/hr ";
cout<<" 3. mg/kg/hr & concerntration in mg/ml ml/hr ";
cout<<" 4. units/hr & concerntration in units/ml ml/hr ";
cout<<" 5. QUIT ";

  
   }
int get_rate_drop_factor(int r,int dr)
{
   float rm;
   float rr;
   rm=(float)r/60;
   rr=(float)dr*rm;
  
   return rr;
  
}


int fig_ml_hr(int h)
{
   int mh;
   mh=1000/h;
   return mh;
}