Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program for the following. Problem: Suppose we want to help the patient to diagnose their health status. Create a program and ask

Write a Java program for the following.

Problem: Suppose we want to help the patient to diagnose their health status. Create a program and ask 3 questions from the patient to evaluate their health status.

Create a Patient class with the following (All of the data members and methods are private).

patientName

patientAge

gender (F-> female, M-> male)

healthStatus

The class include the following functionalities

Constructor with argument to initialize data members (patientName, patientAge, gender).

Getter for all instance variables

Setter for all instance variables

toString() to display Patient information

Create another class Client Class that will include two methods: investigate() and main().

investgiate ():

This method will ask questions from the patient with answers YES or NO. It will increment the healthStatus by one when the answer is YES.

The Questions are

Did you have any health issue like (blood pressure, heart): (YES | NO)

Are you visiting hospitals regularly for health issues: (YES | NO)

Are you smoking three times a day: (YES | NO)

main():

create two objects with the following information

Patient-01: Khalid Ali, 25, M

Patient-02: Asma, 29, F

Ask the patient questions

Display the user information along with health status using the toString() method based on the following criteria.

Number of YES Answer

Health Status

healthStatus = 3

High risk

healthStatus = 2

Medium risk

healthStatus = 1

Low risk

Welcome to Patient Investigation System

Enter your name: Khalid Ali

What is your gender: M

Enter your age: 25

Answer the following questions:

Did you have any health issue like (blood pressure, heart): (YES | NO)YES

Are you visiting hospitals regularly for health issues: (YES | NO) YES

Are you smoking three times a day: (YES | NO) NO

Investigation result for Patient: Khalid Ali, Age 25, gender M: Medium risk

Welcome to Patient Investigation System

Enter your name: Khalid Ali

What is your gender: M

Enter your age: 25

Answer the following questions:

Did you have any health issue like (blood pressure, heart): (YES | NO)YES

Are you visiting hospitals regularly for health issues: (YES | NO) YES

Are you smoking three times a day: (YES | NO) NO

Investigation result for Patient: Khalid Ali, Age 25, gender M: Medium risk

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

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago