Question: Input Your program must take four lines of inputs: A string representing the current blood amounts ( in milliliters ) available in the primary bank

Input
Your program must take four lines of inputs:
A string representing the current blood amounts (in milliliters) available in the primary bank
A string representing the current blood amounts (in milliliters) available in the backup bank
The required blood type from the ER
The required amount of blood (in ml ) from the ER
Both of the first two inputs will contain the information in the following format, with blood types and amounts separated by spaces:
0-100+5A-80A+90B-60B+70AB-50AB+20
Output
The number of lines your program must output will depend on the amount requested.
If the amount to withdraw exceeds the amount stored in the primary and backup banks, your program should only report Error: Amount requested exceeds reserves.
If the amount can be withdrawn, subtract from the primary bank first. If the primary bank is emptied, then subtract from the backup bank.
If the primary bank is left empty after the withdrawal, output Warning: Main reserve depleted. Regardless, then output the amount of blood of the requested type left in the main bank after the withdrawal with the format Main Level:
Input Your program must take four lines of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!