subject
Computers and Technology, 17.04.2021 23:00 youby

Recently you have visited China and you are affected by corona virus so that you have to stay in the hospital for fourteen days. Again, you are

a graduate of Computer Science and Engineering. So, you want to make an

application by which you can track every one of the hospitals those who are affected

by corona virus in the hospital smoothly. The Hospital has only 10 seats for the

patient. On a specific day 10 patient has been admitted in the hospital and 6 of them

are affected by corona virus. Now you have to accomplish the following task.

Define a class Patient that has three instance variables: patientId (int type and

starting from 1 to 10), isCorona (a boolean type; true if the patient has corona; false

otherwise), age(int type). All of the data fields should not be accessible from outside

of the class. Include appropriate constructors. Add toString() method that returns a

string containing patient’s information.

Write a Main class HealthDemo that includes a main() method for testing the

functionalities of these classes: Patient. Create an array of Patient class for 10

Patient’s and invoke add (Paitent) and toString() methods of the Patient class

appropriately. Remember that, for admission of the 10th patient print a message “Seat

is not available”. Finally print the sum of the ages of the people affected by corona

virus.

Hint: use static variable wisely.
Using Java programming language

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
Which of the following is a way that advancements in technology improve humans' ability to measure air quality and protect human health? a. air quality data gathered by new instruments can be used to reduce exposure to pollutants. b. new technologies enable natural and human-made pollution sources to be located and monitored. c. air quality data gathered by new instruments can be used to predict trends in pollution over time. d. new technologies allow governments to make informed decisions about the regulation of pollution. (choose more than one)
Answers: 2
question
Computers and Technology, 24.06.2019 17:00
What are some examples of what can be changed through options available in the font dialog box? check all that apply. font family italicizing bolding pasting drop shadow cutting character spacing special symbols
Answers: 2
question
Computers and Technology, 24.06.2019 20:00
Individuals suffering from technology overload feel distressed when deprived of computers and mobile devices.true/fasle
Answers: 2
question
Computers and Technology, 25.06.2019 01:30
What was the advantage of using transistors instead of vacuum tubes in the second-generation computers? a. computers were drastically reduced in size. b. computers no longer produced errors. c. computers became affordable. d. computers could run on electricity.
Answers: 1
You know the right answer?
Recently you have visited China and you are affected by corona virus so that you have to stay in th...
Questions
question
English, 21.02.2021 14:00
question
Geography, 21.02.2021 14:00
question
Mathematics, 21.02.2021 14:00
question
Mathematics, 21.02.2021 14:00
question
English, 21.02.2021 14:00
Questions on the website: 13722367