Professional Documents
Culture Documents
Lab 07
Lab 07
Lab 07
Student Matric No :
Student Name:
Program: HC00/ HC05 / HC14
Learning Objectives/Outcomes:
Upon completion of this lab, the student should be able to:
i. define, initialize and use pointer
ii. work with a common algorithm for processing the value of pointers
iii. write a function that receives andreturnsn pointers
iv. apply the concepts of pointers in solving the complex programming problems
SAMPLE RUN:
ASCENDING ORDER PROGRAM
Enter three numbers separated by single blanks => 7.5 9.6 5.5
The number in ascending order is : 5.50 7.50 9.60
void instruct(void);
void dispenser (int amount, int *th, int *ft, int *tw, int *tn);
Sample Run :
ABC BANK Automatic Teller Machine ATM
Enter withdraw Amount: 1
Invalid Input!
Please enter a multiple of 10 dollars
Sample Run:
INTRAVENOUS RATE ASSISTANT
Problem=>1
Enter the rate in ml/hr => 150
Enter tubing’s drop factor (drops/ml) => 15
The drop rate per minute is 38.
For more example of sample run, kindly refer to textbook, question 2 page 353.
Your program should include the following functions :
• get_problem : Display the user menu, then inputs and returns as the function value
the problem number selected.
• get_rate_drop_factor : Prompts the user to enter the data required for problem 1,
and send this data back to the calling module via output parameters.
• get_kg_rate_conc-prompts the user to enter the data required for problem 3, and
sends this data back to calling module via output parameters.
• get_unit_conc- prompts the user to enter the data required for problem 4 and sends
this data back to calling module via output parameters.
• fig_drops_min - takes rate and drop factor as input parameters and returns
drops/min (rounded to nearest whole drop) as function value
• fig_ml_hr – takes as input parameter the number of hours over which one liter is to be
divired and returns ml/hr (rounded) as function value.
• by_weight – Takes as input parameters rate in mg/kg/hr, patient weight in kg, and
concentration of drug in mg/ml and returns ml/hr (rounded) as function value.
• by_units – Takes as input parameters rate in units/hr and concentration in units/ml,
and returns ml/hr(rounded) as function value.
[ Hint : Use a sentinel-controlled loop. Call get_problem once before the loop to
initialize the problem number and once again at the end of the loop body to update it ].
Marking Rubrics:
Assessment Rubric:
Criteria Advanced Proficient Functional Developing
(10-9) (8-7) (6-4) (0-3)
Applicability of Shows excellent Shows a good Shows minimal Show no
Concepts in understanding of understanding of understanding of understanding of
solving given the theory taught the theory taught the theory taught the theory taught
problems and is able to and is able to and is able to and is able to
(5%) integrate the integrate the integrate the integrate the
concepts in solving concepts in solving concepts in solving concepts in solving
the given problems the given problems the given problems the given problems
Delivery The program was The program was The code was The code was
(Deduction from delivered on time delivered within a within 2 more
overall scoring) week weeks of the due than 2 weeks
of the due date. date overdue.