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 19:00
In he example code, what does the title attribute create? a tool tip an element a source a markup
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
question
Computers and Technology, 24.06.2019 14:40
Create a function (prob3_6) that will do the following: input a positive scalar integer x. if x is odd, multiply it by 3 and add 1. if the given x is even, divide it by 2. repeat this rule on the new value until you get 1, if ever. your program will output how many operations it had to perform to get to 1 and the largest number along the way. for example, start with the number 3: because 3 is odd, we multiply by 3 and add 1 giving us 10. 10 is even so we divide it by 2, giving us 5. 5 is odd so we multiply by 3 and add one, giving us 16. we divide 16 (even) by two giving 8. we divide 8 (even) by two giving 4. we divide 4 (even) by two giving 2. we divide 2 (even) by 2 to give us 1. once we have one, we stop. this example took seven operations to get to one. the largest number we had along the way was 16. every value of n that anyone has ever checked eventually leads to 1, but it is an open mathematical problem (known as the collatz conjectureopens in new tab) whether every value of n eventually leads to 1. your program should include a while loop and an if-statement.
Answers: 3
question
Computers and Technology, 24.06.2019 15:30
Emma is using an artificial intelligence system, which contains information on botany, to identify a type of plant from an image. what type of ai is emma using?
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
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
English, 17.09.2020 14:01
question
Social Studies, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Biology, 17.09.2020 14:01
question
Social Studies, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
English, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Social Studies, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
Questions on the website: 13722367