Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions

Question

How can the Internet be helpful in a job search? (Objective 2)

Answered: 1 week ago