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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started