Question: Create a program BloodTransfusions with static method findRecipient that takes a donor blood type as an argument. public static String findRecipient( String donor ) The

Create a program BloodTransfusions with static method findRecipient that takes a donor blood type as an argument. public static String findRecipient( String donor ) The method has a switch statement with each case a donor blood type (O, A, B, AB). Provide a case for uppercase and lowercase donor types, and a default case for an unknown blood type. The method will return a String with the corresponding recipient blood type(s) or an error message if unknown. Do NOT return from within the switch statement. Return the recipient type(s) AFTER the switch statement.

For information about blood donor types and recipients go here:

http://www.redcrossblood.org/learn-about-blood/blood-types (Links to an external site.)Links to an external site.

The program will prompt for a donor blood type, will call the findRecipient method and will display the blood type(s) returned from the method. The program must keep running until the user enters n to quit. Use a while or a do-while loop for this.

Be sure to label the output. Use the command prompt window (terminal).

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 Databases Questions!