Total Amount per Blood Type A: B: p500 O: AB: p703.5 Buy another blood? N Total Amount: p1203.5 Amount Paid: p1500.00 (will not accept if amount paid is less than total amount) 1. Design a program that allows user to input the ff. DESCRIPTION TYPE VARNAME Customer Number integer CustomerN SEX (M/F) char SEX Blood Type<0-3> integer btype No. of Liters float/double NOL Amount Paid float/double amt Total Amount float/double t_amt
Customer Number Sex Blood Type No. Of Liters
2 M 1 4
Total Amount per Blood Type A:
B: p500
O:
AB: p703.5
Buy another blood<Y/N>? N
Total Amount: p1203.5
Amount Paid: p1500.00
(will not accept if amount paid is less than total amount)
1. Design a program that allows user to input the ff.
DESCRIPTION TYPE VARNAME
Customer Number integer CustomerN
SEX (M/F) char SEX
Blood Type<0-3> integer btype
No. of Liters float/double NOL
Amount Paid float/double amt
Total Amount float/double t_amt
2. Count Dracula prefers various type of blood, his rate per liter for each btype are given as follows.
Type A - p300 plus 20.0025 for every liter
B- p500 for the 1st 5 liters, and 60.0025 per liter in excess of 5 liters.
AB- p400 for the 1st 3 liters
P500 above 3 liters but below 5 liters
P700 if equal to 5 liters and p1.75 per liter beyond 5 liters
O- p250 per liter
7 liters of AB
excess = 2 *1.75
total AB amount = 700 + excess
3. Your program should process N number of transactions. (at least 2)
4. Validation for Sex is required. – M/m and F/f
5. Blood Type is defined by the ff
0 - A
1 - B
2 - AB
3 - O
6. Compute the Total Amount per liter per blood type, then display the Total Amount after user selected N for processing another transaction.
Step by step
Solved in 6 steps with 3 images