Instructions Create a class named BloodData that includes String fields that hold a blood type as...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Instructions Create a class named BloodData that includes String fields that hold a blood type as bloodType (the four blood types are O, A, B, and AB) and an Rh factor as rhFactor (the factors are + and -). Create the BloodData class. Tasks Add the data fields to the BloodData class. Create a default constructor that sets the fields to 0 and + and an overloaded constructor that requires values for both fields. Tasks Create a default BloodData constructor. Include get and set methods for each field. Create an overloaded BloodData constructor. Tasks Add set and get methods for the bloodType data field. Add set and get methods for the rhFactor data field. ||| > > > > Instructions Part B Create an application named TestBloodData that declares two objects. Prompt the user for values for one, and use the default constructor values for the other. Display the details of both objects. Then change the values in the default object so it also uses the user's values, and display the details for the object again to confirm the changes are made correctly. An example of the program is shown below: Enter blood type >> AB Enter RH factor >> - The blood is type 0+ The blood is type AB+ The blood is type AB+ Create the TestBloodData application. |||| Task > Instructions Create the Patient class. Add the data fields to the Patient class. Create a default Patient constructor. Tasks Provide get methods for each field. Provide a default constructor that sets the ID number to O, the age to O, and the BloodData values to the default Blood Data values (O and +). Create an overloaded constructor that provides values for each field. Create an overloaded Patient constructor. Add a get method for the id data field. Tasks Tasks Add a get method for the age data field. |||| Add a get method for the bloodData data field. > > > > > > > Instructions Part D Create an application called Test Patient that declares three Patient objects. Use all default values for one Patient object, prompt the user for values for the second Patient object, and for the third object, prompt the user for Patient data but use default values for that Patient's BloodData. An example of the program is shown below: Enter ID number for patient >> 13 Enter age for patient 13 >> 23 Enter blood type for patient 13 >> AB Enter RH factor for patient 13 >> - Enter ID number for second patient >> 99 Enter age for patient 99 >> 12 Patient #0 age: 0 The blood is type 0+ Patient #13 age: 23 The blood is type AB- Patient #99 age: 12 The blood is type 0+ Create the Test Patient application. ||| Task Instructions Create a class named BloodData that includes String fields that hold a blood type as bloodType (the four blood types are O, A, B, and AB) and an Rh factor as rhFactor (the factors are + and -). Create the BloodData class. Tasks Add the data fields to the BloodData class. Create a default constructor that sets the fields to 0 and + and an overloaded constructor that requires values for both fields. Tasks Create a default BloodData constructor. Include get and set methods for each field. Create an overloaded BloodData constructor. Tasks Add set and get methods for the bloodType data field. Add set and get methods for the rhFactor data field. ||| > > > > Instructions Part B Create an application named TestBloodData that declares two objects. Prompt the user for values for one, and use the default constructor values for the other. Display the details of both objects. Then change the values in the default object so it also uses the user's values, and display the details for the object again to confirm the changes are made correctly. An example of the program is shown below: Enter blood type >> AB Enter RH factor >> - The blood is type 0+ The blood is type AB+ The blood is type AB+ Create the TestBloodData application. |||| Task > Instructions Create the Patient class. Add the data fields to the Patient class. Create a default Patient constructor. Tasks Provide get methods for each field. Provide a default constructor that sets the ID number to O, the age to O, and the BloodData values to the default Blood Data values (O and +). Create an overloaded constructor that provides values for each field. Create an overloaded Patient constructor. Add a get method for the id data field. Tasks Tasks Add a get method for the age data field. |||| Add a get method for the bloodData data field. > > > > > > > Instructions Part D Create an application called Test Patient that declares three Patient objects. Use all default values for one Patient object, prompt the user for values for the second Patient object, and for the third object, prompt the user for Patient data but use default values for that Patient's BloodData. An example of the program is shown below: Enter ID number for patient >> 13 Enter age for patient 13 >> 23 Enter blood type for patient 13 >> AB Enter RH factor for patient 13 >> - Enter ID number for second patient >> 99 Enter age for patient 99 >> 12 Patient #0 age: 0 The blood is type 0+ Patient #13 age: 23 The blood is type AB- Patient #99 age: 12 The blood is type 0+ Create the Test Patient application. ||| Task
Expert Answer:
Answer rating: 100% (QA)
BloodDatajava class BloodData String bloodType String rhFactor BloodData thisbloodTypeO thisrhFactor BloodDataString bloodType String rhFactor thisblo... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Discuss the types of securities used currently in Pakistan and check marketable securities purchased by any company. Discuss 3 forms of markets also Discuss the performances of these markets in past...
-
a. Create a class named BloodData that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an Rh factor (the factors are 1 and ). Create a default constructor that...
-
Create a class named BloodData that includes fields that hold a blood type (the four blood types are O , A , B , and AB ) and a Rh factor (the factors are + and ). Create a default constructor that...
-
The following data have been extracted from the financial statements of Prentiss, Inc., a calendar-year merchandising corporation: Total sales for 2018 were $1,200,000 and for 2017 were $1,100,000....
-
Locate the centroid yc of the shaded area. Solve the problem by evaluating the integrals using Simpson's rule. Given a = 2 ft .. (x, y) y = Jx* + 2 (x) + 2a (x)*+2 (x)
-
You and a friend from school formed a business that has become wildly successful. Now you are taking the company public in an IPO. Congratulations! You and your friend initially formed the...
-
Assume that the current measurements in a strip of wire follow a normal distribution with a mean of 10 milliamperes and a variance of 4 (milliamperes) \({ }^{2}\). What is the probability that a...
-
The chapter opener discusses the series of problems Nike has had with some of its endorsers because of controversies that have arisen in their personal lives. Discuss how the problems surrounding...
-
How can companies and marketing teams, in particular, anticipate how AI will impact market research? As AI continues to be developed even further, how do you foresee that it will disrupt the...
-
The following summarized data (amounts in millions) are taken from the September 26, 2020, and September 28, 2019, comparative financial statements of Apple Incorporated, a company that designs,...
-
PREPARE 1. TRIAL BALANCE 2. LEDGER DATE 2020, Aug 1 PARTICULARS Cash De Leon, Capital Office Supplies Cash 2 Taxes and Licenses Cash 3 Cash 4 Furniture and Fixtures Computer Cash DR Loan, Capital -...
-
WTVX, Channel 6, is located in Eugene, Oregon, home of the University of Oregons football team. The station was owned and operated by George Wilcox, a former Duck (University of Oregon football...
-
A $850,000 mortgage is financed using a 30-year constant payment product at 3.50% interest. Assuming that the loan is held to maturity, i.e., the house is paid off, without any refinancing, in 30...
-
Use the information from BE23-4 for Bloom Corporation. Prepare the cash flows from operating activities section of Blooms 2015 statement of cash flows using the indirect method. Data From BE 23-4...
-
Suppose there are three individuals, Boris, Maggie, and William. They are using majority rule to decide among themselves whether to go hiking in the wilderness this weekend \((\mathrm{H})\), kayaking...
-
Sketch the titration curve from Problem 123 by calculating the pH at the beginning of the titration, at one-half of the equivalence point, at the equivalence point, and at 5.0 mL beyond the...
-
When displaying a web page, the application layer uses the O a. HTTP protocol Ob. SMTP protocol Oc. TCP protocol O d. FTP protocol
-
Estimate a range for the optimal objective value for the following LPs: (a) Minimize z = 5x1 + 2x2 Subject to X1 - x2 3 2x1 + 3x2 5 X1, x2 0 (b) Maximize z = x1 + 5x2 + 3x3 Subject to X1 + 2x2 +...
-
An advantage of extending the jframe class is ____________. A. You can set the child class properties within the class constructor B. There is no other way to cause an application to close when the...
-
Create a file that contains a line of your favorite song lyric. Use a text editor such as Notepad, and save the file. Copy the file contents, and paste them into a word-processing program such as...
-
Which of the following is true if a successfully running program contains the following statement: Arrays.fill(tax, 10); a. Tax is a two-dimensional array. b. fill() is a nonstatic method. c. Tax is...
-
Universities are interested in increasing donations from their alumni. Donations from former students help fund important building projects, upgrade existing facilities, support student...
-
Figure P16.36 shows the two lowest resonances recorded in the vocal tract of the eastern towhee, a small songbird. a. Is this birds vocal tract better modeled as an open-open tube or an open-closed...
-
Two loudspeakers, 1.0 m apart, emit sound waves with the same frequency along the positive x-axis. Victor, standing on the axis to the right of the speakers, hears no sound. As the frequency is...
Study smarter with the SolutionInn App