Introduction to Programing using Java Assignment, NTU, Singapore: Create a class named BloodData that includes fields that hold a blood type (the four blood types are O, A, B, and AB)
| University | Nanyang Technological University (NTU) |
Question 3
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 + and –). Create a default constructor that sets the fields to “O” and “+”, andan overloaded constructor that requires values for both fields. Include get and set methods for each field. Save this file as BloodData.java. Create an application named TestBloodData that demonstrates that each method works correctly. Save the application as TestBloodData.java.
b) Create a class named Patient that includes an ID number, age, and BloodData. Provide a default constructor that sets the ID number to “0”, the age to 0, and the BloodData to “O” and “+”. Create an overloaded constructor that provides values for each field. Also provide get methods for each field. Save the file as Patient.java. Create an application named TestPatient that demonstrates that each method works correctly, and save it as TestPatient.java.
Hire a Professional Essay & Assignment Writer for completing your Academic Assessments
Feeling overwhelmed with your Introduction to Programming using Java Assignment at NTU, Singapore? No worries – we're here to lend a hand! Our online exams help and assignment help Singapore services offer tailored support to suit your needs.
- ANL252 Python for Data Analytics ECA July 2026: Payment Delay Data Cleaning, Charts and Regression | SUSS
- EG7060 Mental Wealth: Professional Life Coursework 2026: Engineering Management Case Study Report | UEL at LSBF
- SOC252 Religion and Society ECA July 2026: AI Agents and Religious Authority Essay | SUSS
- Information Studies Written Report: Critiquing a ChatGPT Essay on Values, Ethics and IPR | NTU
- BML701 Changing Context of Work: HR&OD Business Report on PESTLE, 6Ps and Change
- ABS103 ECA July 2026: “A Day in the Life” Intelligence Video and Reflection | SUSS
- ICT340 NEA Hawker Centre Inspection ECA July 2026: Application Analysis and Design | SUSS
- Social and New Media Written Report (40%): Website Message and Method Analysis with Strategic Recommendations | Murdoch
- ENG235 AIoT End-of-Course Assessment July 2026: PowerGrid SG Smart Grid and Utilities Case | SUSS
- BME363 ChatEHR End-of-Course Assessment July 2026: Large Language Models in Clinical Care | SUSS
