Here is how the code works
1. Patient.java is an Abstract Class which contains the required attributes and a constructor for
initializing the Patient object
2. PatientImpl.java is a class which extends the Abstract class Patient.java and contains a
constructor which makes a call to the superclass and initializes the superclass with passed
arguments
3. PatientComparator.java is a class which implements the comparator interface and specfies the
criteria for comparing two Patient objects
4. Main.java drives the complete program by providing a menu to the user with the three options
that is for adding a patient, finding the next highest priority patient to be served and exiting the
program
Please find the code as follows:-
Patient.java Code:-
package com.chegg.patient;
import java.util.Date;
abstract class Patient {
private String name;
private Date dob;
private Date admission;
private String complaint;
private int priority;
public Patient(String name, Date dob, Date admission, String complaint, int priority) {
this.name = name;
this.dob = dob;
this.admission = admission;
this.complaint = complaint;
this.priority = priority;
}
public String toString() {
return this.name + this.dob + this.admission + this.complaint + this.priority;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getDob() {
return dob;
}
public void setDob(Date dob) {
this.dob = dob;
}
public Date getAdmission() {
return admission;
}
public void setAdmission(Date admission) {
this.admission = admission;
}
public String getComplaint() {
return complaint;
}
public void setComplaint(String complaint) {
this.complaint = complaint;
}
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
}
}
PatientImpl.java Code
package com.chegg.patient;
import java.util.Date;
public class PatientImpl extends Patient {
public PatientImpl(String name, Date dob, Date admission, String complaint, int priority) {
super(name, dob, admission, complaint, priority);
}
}
PatientComparator.java Code
package com.chegg.patient;
import java.util.Comparator;
public class PatientComparator implements Comparator {
@Override
public int compare(Patient arg0, Patient arg1) {
if(arg0.getPriority() == arg1.getPriority()){
if(arg0.getAdmission().compareTo(arg1.getAdmission())==-1){
return -1;
}
else
return 1;
}
if(arg0.getPriority() comparator = new PatientComparator();
PriorityQueue Pq = new PriorityQueue(10, comparator);
while (true) {
System.out.println(\"1. Enter New Patient Data\");
System.out.println(\"2. Retrieve Next Patient to treat\");
System.out.println(\"3. Exit\");
choice = sc.nextInt();
sc.nextLine();
switch (choice) {
case 1: {
System.out.println(\"Enter Name\");
name = sc.nextLine();
System.out.println(\"Enter Date of birth in format yyyy-mm-dd\");
String dob_String = sc.next();
dob = parseDate(dob_String);
admission = new Date();
System.out.println(\"Enter Complaint\");
sc.nextLine();
comp.
Sorting Questions (JAVA)
See attached classes below.
Attached Classes
-------------------------------------------
Patient.java
package A9.toStudents;
public class Patient implements Comparable{
//attributes
private int order;
private String name;
private boolean emergencyCase;
//constructor
public Patient(int order, String name, boolean emergencyCase) {
this.order = order;
this.name = name;
this.emergencyCase = emergencyCase;
}
//compareTo
public int compareTo(Patient other) {
if(this.isEmergencyCase() && !other.isEmergencyCase())
return -1; //place this first
else if(!this.isEmergencyCase() && other.isEmergencyCase())
return 1; //place other first
else //if both are emergency or both are not emergency
return this.getOrder()-other.getOrder(); //place smaller order first
}
//getters and setters
public int getOrder() {
return order;
}
public void setOrder(int order) {
this.order = order;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isEmergencyCase() {
return emergencyCase;
}
public void setEmergencyCase(boolean emergencyCase) {
this.emergencyCase = emergencyCase;
}
public String toString() {
return (isEmergencyCase()?\"*\":\"\") + name;
}
}
--------------------------------------------------------
PatientComparator.java
package A9.toStudents;
import java.util.Comparator;
public class PatientComparator implements Comparator{
public int compare(Patient p1, Patient p2) {
if(p1.isEmergencyCase() && !p2.isEmergencyCase())
return -1; //place p1 first
else if(!p1.isEmergencyCase() && p2.isEmergencyCase())
return 1; //place p2 first
else //if both are emergency or both are not emergency
return p1.getOrder()-p2.getOrder(); //place smaller order first
}
}
---------------------------------
PatientTestQ12.java
package A9.toStudents;
import java.util.ArrayList;
public class PatientTestQ12 {
public static void main(String[] args) {
ArrayList list = new ArrayList<>(5);
list.add(new Patient(1, \"p1\", false));
list.add(new Patient(2, \"p2\", false));
list.add(new Patient(3, \"p3\", true));
list.add(new Patient(4, \"p4\", false));
list.add(new Patient(5, \"p5\", true));
//before sorting
System.out.printf(\"%-15s%25s\ \", \"Before sorting\", list); //should be [p1, p2, p3, p4, p5]
//try bubble sort methods for Q1
//Sorter.bubbleSort(list);
//Sorter.bubbleSort(list, new PatientComparator());
//other sort methods for Q2
//Sorter.selectionSort(list);
//Sorter.insertionSort(list);
//after sorting
System.out.printf(\"%-15s%25s\ \", \"After sorting\", list); //should be [p3, p5, p1, p2, p4]
}
} In this assignment, you will build a class that can be used to sort a list of patient using
different algorithms, and you will also compare the time efficiency of these algorithms
Download the following files from Connect to help you work on this assignment: Patient.java
PatientComparator.java PatientTestQ12.java Q1. Create a class called Sorter that has two static
methods: (10 marks) public static void bubbleSo.
Patient.java package A9.toStudents; public class Patient imple.pdfDEEPAKSONI562
//Patient.java
package A9.toStudents;
public class Patient implements Comparable
{
//attributes
private int order;
private String name;
private boolean emergencyCase;
//constructor
public Patient(int order, String name, boolean emergencyCase) {
this.order = order;
this.name = name;
this.emergencyCase = emergencyCase;
}
//compareTo
public int compareTo(Patient other) {
if(this.isEmergencyCase() && !other.isEmergencyCase())
return -1; //place this first
else if(!this.isEmergencyCase() && other.isEmergencyCase())
return 1; //place other first
else //if both are emergency or both are not emergency
return this.getOrder()-other.getOrder(); //place smaller order first
}
//getters and setters
public int getOrder() {
return order;
}
public void setOrder(int order) {
this.order = order;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isEmergencyCase() {
return emergencyCase;
}
public void setEmergencyCase(boolean emergencyCase) {
this.emergencyCase = emergencyCase;
}
public String toString() {
return (isEmergencyCase()?\"*\":\"\") + name;
}
}
----------------------------------------------------------------------------
//PatientComparator.java
package A9.toStudents;
import java.util.Comparator;
public class PatientComparator implements Comparator
{
public int compare(Patient p1, Patient p2)
{
if(p1.isEmergencyCase() && !p2.isEmergencyCase())
return -1; //place p1 first
else if(!p1.isEmergencyCase() && p2.isEmergencyCase())
return 1; //place p2 first
else //if both are emergency or both are not emergency
return p1.getOrder()-p2.getOrder(); //place smaller order first
}
} //end of the PatientComparator
----------------------------------------------------------------------------
/*Sorter class contains static methods that take ArrayList
and sorts the list using bubble sort,insertion sort and
selection sort */
//Sorter.java
package A9.toStudents;
import java.util.ArrayList;
public class Sorter
{
//Bubble sort
public static void bubbleSort(ArrayList list)
{
for (int c = 0; c < ( list.size() - 1 ); c++)
{
for (int d = 0; d < list.size() - c - 1; d++)
{
if (list.get(d).compareTo(list.get(d+1))>0)
/* For ascending order*/
{
Patient temp= list.get(d);
list.set(d, list.get(d+1));
list.set(d+1, temp);
}
}
}
}
//Selection sort
public static void selectionSort(ArrayList list)
{
for (int i = 0; i < list.size() - 1; i++)
{
int index = i;
for (int j = i + 1; j < list.size(); j++)
if (list.get(j).compareTo(list.get(index))<0)
index = j;
Patient tempPatient = list.get(index);
list.set(index, list.get(i));
list.set(i,tempPatient);
}
}
//Insertion sort
public static void insertionSort(ArrayList list)
{
for (int i = 1; i < list.size(); i++)
{
for(int j = i ; j > 0 ; j--)
{
if(list.get(j).compareTo(list.get(j-1))<0)
{
Patient temp = list.get(j);
list.set(j,list.get(j-1));
list.set(j-1,temp);
}
}
}
}
public static void bubbleSort(ArrayList list,
PatientComparator patientComparator) {
for (int c = 0; c < ( list.s.
Ive already completed the Java assignment below, but it doesnt wor.pdffantasiatheoutofthef
I've already completed the Java assignment below, but it doesn't work. I will include my code
and the tests. Please correct my code and tests to that they match what has been asked and
reached 95% test coverage as asked for in the assignment.
Assignment: Disease File Repository
This assignment is a continuation of the last assignment. Please use the Eclipse project that you
created in the first assignment for this work.
Source Code
Class: Exposure
Copy the Exposure class from the previous assignment into the new. Make the necessary
changes so that this class can be serialized.
Class: Patient
Copy Patient class from the previous assignment into the new. Make the necessary changes so
that this class can be serialized and that it uses the Exposure class class.
Class: Disease
Copy the Disease, the InfectiousDisease, the NonInfectiousDisease classes from the previous
assignment into the new. Make the necessary changes so that they can be serialized.
Class: DiseaseAndPatient
Create a class called DiseaseAndPatient and define the follwing properties:
private Disease[] diseases;
private Patients[] patients;
Create getter and setter methods for the two arrays and document the new methods using the
Javadoc standard.
Class: DiseaseFileRepository
Create a class called DiseaseFileRepository and define the following methods:
DiseaseAndPatient init(String folderPath)
This method accepts a file path to the folder where the data was serialiaed and set the folder path
to a propert on this class. Deserialize the disease data from the file named diseases.dat.
Deserialize the patient data from the file named patients.fat. Set both the deserialized disease and
patient arrays to an instance of the DiseaseAndPatient class and return that instance. Throw an
IllegalArgumentException with an appropriate message if the supplied folder path is null.
void save(Disease[] diseases, Patient[] patients)
This method serializes and saves the supplied disease and patient array data to two separate files
on the file system using the folder path from the init method. Serialize the disease array data to a
file named disease.dat and the patient array data to the file name patients.dat.
Documentation
You are required to document the class, constructor, and methods using Javadoc standard.
Class: DiseaseFileRepositoryTest
Create a class called DiseaseFileRepositoryTest to test your DiseaseFileRespository class. You
must achieve at least 95% test coverage on the DiseaseFileRepository class.
Class: DiseaseControlManager and DiseaseControlManagerImpl
Copy the DiseaseControlManager interface and the DiseaseControlMangerImpl class from the
previous assignment and into the new. The DiseaseControlManager implementation will use the
DiseaseFileRepository class that you created in this assignment to initialize and save the disease
and patient data.
Constructor
Add a DiseaseFileRepository property to the DiseaseControlManager implementation and
initialize the property in the constructor of the D.
Define a class named Doctor whose objects are records for clinic’s d.pdfMALASADHNANI
Define a class named Doctor whose objects are records for clinic’s doctors. Derive this class
from the class Person given in listing 8. A Doctor record has the doctor’s name—defined in the
class Person—A specialty as a string (for example Pediatrician, Obstetrician, General
Practitioner, and so on), and office visit fee (use type double). Give your class has a reasonable
complement of constructors, accessor methods and an equals method as well. Write a driver
program to test all your methods.
this is the test file
modify this to make the test file work
Solution
//class doctor extended from person
class Doctor extends Person
{
//instnace variables
String specialty;
double fee;
//default construtor
public Doctor()
{
super();
specialty=\"\";
fee=0;
}
//parameterized contstructor with name as paratemetr
public Doctor(String n)
{
super(n);
specialty=\"\";
fee=0;
}
//constructor accepting name and specialty
public Doctor(String n,String s)
{
super(n);
specialty=s;
fee=0;
}
//constructor accepting name and fee
public Doctor(String n,double f)
{
super(n);
specialty=\"\";
fee=f;
}
//constructor accepting name,fee and specialy
public Doctor(String n,double f,String s)
{
super(n);
specialty=s;
fee=f;
}
//method to set variables for doctor
public void set(String n,double f,String s)
{
set(n);
specialty=s;
fee=f;
}
//setter for fee
public void setOfficeFee(double f)
{
fee=f;
}
//setter for spciality
public void setSpecialty(String s)
{
specialty=s;
}
//getter for speciality
public String getSpecialty()
{
return specialty;
}
//getter for fee
public double getOfficeFee()
{
return fee;
}
//set fee
public void writeOfficeFee()
{
fee=0;
}
//set specislity
public void writeSpecialty()
{
specialty=\"No specialty yet.\";
}
//compare two doctor objects
public boolean equals(Doctor d)
{
return hasSameName(d) && fee==d.fee && specialty.equals(d.specialty);
}
//display doctor detais
public void writeOutput()
{
super.writeOutput();
System.out.println(\"Speciality: \" +specialty);
System.out.println(\"Fee: \"+fee);
}
}
class Person
{
private String name;
public Person()
{
name = \"No name yet.\";
}
public Person(String initialName)
{
name = initialName;
}
public void setName(String newName)
{
name = newName;
}
public void set(String newName)
{
name = newName;
}
public void writeName()
{
name = \"No name yet.\";
}
public String getName()
{
return name;
}
public void writeOutput()
{
System.out.println(\"Name: \" + name);
}
public boolean hasSameName(Person otherPerson)
{
return (this.name.equalsIgnoreCase(otherPerson.getName()));
}
}
import java.util.*;
public class DoctorTest{
public static void main(String []args){
Scanner keyboard = new Scanner(System.in);
char repeat;
do // repeat if user says \'yes\'
{
// Test the six constructors (uses writeOutput method)
Doctor drNo = new Doctor();
System.out.println(\"Using default constructor:\");
System.out.println();
System.out.println(\"Verify:\");
System.out.println(\"No name yet.\");
System.out.println(\"$150\");
System.out.
i need help to edit the two methods below so that i can have them wo.pdfirshadoptical
I have to make a program for my C class and im stuck on the part where i have to calculate the
variance with elements from my array. This is exactly what im suppose to do:
Reset the sum variable to 0
Using another for loop (which needs its own loop variable), run through all valid elements of the
array, starting from index 0. Inside the loop:
Use the sum variable to accumulate the numerator of the variance formula shown on page 1.
After the end of this loop, compute the variance by dividing the new sum by the
dataElementsToProcess parameter.
this is the entire function
bool GenerateStatistics(FILE *fp2, double myArray[], int dataElementsToProcess)
{
if (fp2 == NULL && myArray == NULL && dataElementsToProcess < 1)
{
return false;
}
else
{
int i = 0,o = 0;
int sum = 0, sum1 = 0;
double maxValue = 0;
double minValue = DBL_MAX;
double mean, variance, stdDeviation;
for (int i = 0; i < 600; i++)
{
sum += myArray[i];
if (myArray[i] > maxValue)
{
maxValue = myArray[i];
}
if (myArray[i] < minValue)
{
minValue = myArray[i]; }
}
mean = sum / dataElementsToProcess;
sum = 0;
for (int o = 0; o < 600; o++)
{
sum += myArray[o];
}
variance = sqrt(pow((sum - mean), 2) / (dataElementsToProcess));
stdDeviation = sqrt(variance);
fprintf(fp2, \"Reaction Rate Statistics:\ \ \");
fprintf(fp2, \"Number of experiments = %d\ \", dataElementsToProcess);
fprintf(fp2, \"Minimum rate\\t\\t= %f\ \", minValue);
fprintf(fp2, \"Maximum rate\\t\\t= %f\ \", maxValue);
fprintf(fp2, \"Arithmetic mean\\t\\t= %f\ \", mean);
fprintf(fp2, \"Variance\\t\\t= %f\ \", variance);
fprintf(fp2, \"Standard deviation\\t= %f\ \ \ \", stdDeviation);
}
return true;
}
Solution
Here in the function you have
average - mean
Noofelements - dataElementsTo Process
Variance formula is
V = summation over i=1 to n ((xi - mean )*(xi - mean))
So perform like this using a for loop over my_array
double V=0.0
for(int i=0;i<600;i++)
{
V=V+pow((my_Array[i]-mean),2)
}
Now calculate standard deviation using sqrt of variance
sd=0.0
sd=sqrt(V).
Sorting Questions (JAVA)
See attached classes below.
Attached Classes
-------------------------------------------
Patient.java
package A9.toStudents;
public class Patient implements Comparable{
//attributes
private int order;
private String name;
private boolean emergencyCase;
//constructor
public Patient(int order, String name, boolean emergencyCase) {
this.order = order;
this.name = name;
this.emergencyCase = emergencyCase;
}
//compareTo
public int compareTo(Patient other) {
if(this.isEmergencyCase() && !other.isEmergencyCase())
return -1; //place this first
else if(!this.isEmergencyCase() && other.isEmergencyCase())
return 1; //place other first
else //if both are emergency or both are not emergency
return this.getOrder()-other.getOrder(); //place smaller order first
}
//getters and setters
public int getOrder() {
return order;
}
public void setOrder(int order) {
this.order = order;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isEmergencyCase() {
return emergencyCase;
}
public void setEmergencyCase(boolean emergencyCase) {
this.emergencyCase = emergencyCase;
}
public String toString() {
return (isEmergencyCase()?\"*\":\"\") + name;
}
}
--------------------------------------------------------
PatientComparator.java
package A9.toStudents;
import java.util.Comparator;
public class PatientComparator implements Comparator{
public int compare(Patient p1, Patient p2) {
if(p1.isEmergencyCase() && !p2.isEmergencyCase())
return -1; //place p1 first
else if(!p1.isEmergencyCase() && p2.isEmergencyCase())
return 1; //place p2 first
else //if both are emergency or both are not emergency
return p1.getOrder()-p2.getOrder(); //place smaller order first
}
}
---------------------------------
PatientTestQ12.java
package A9.toStudents;
import java.util.ArrayList;
public class PatientTestQ12 {
public static void main(String[] args) {
ArrayList list = new ArrayList<>(5);
list.add(new Patient(1, \"p1\", false));
list.add(new Patient(2, \"p2\", false));
list.add(new Patient(3, \"p3\", true));
list.add(new Patient(4, \"p4\", false));
list.add(new Patient(5, \"p5\", true));
//before sorting
System.out.printf(\"%-15s%25s\ \", \"Before sorting\", list); //should be [p1, p2, p3, p4, p5]
//try bubble sort methods for Q1
//Sorter.bubbleSort(list);
//Sorter.bubbleSort(list, new PatientComparator());
//other sort methods for Q2
//Sorter.selectionSort(list);
//Sorter.insertionSort(list);
//after sorting
System.out.printf(\"%-15s%25s\ \", \"After sorting\", list); //should be [p3, p5, p1, p2, p4]
}
} In this assignment, you will build a class that can be used to sort a list of patient using
different algorithms, and you will also compare the time efficiency of these algorithms
Download the following files from Connect to help you work on this assignment: Patient.java
PatientComparator.java PatientTestQ12.java Q1. Create a class called Sorter that has two static
methods: (10 marks) public static void bubbleSo.
Patient.java package A9.toStudents; public class Patient imple.pdfDEEPAKSONI562
//Patient.java
package A9.toStudents;
public class Patient implements Comparable
{
//attributes
private int order;
private String name;
private boolean emergencyCase;
//constructor
public Patient(int order, String name, boolean emergencyCase) {
this.order = order;
this.name = name;
this.emergencyCase = emergencyCase;
}
//compareTo
public int compareTo(Patient other) {
if(this.isEmergencyCase() && !other.isEmergencyCase())
return -1; //place this first
else if(!this.isEmergencyCase() && other.isEmergencyCase())
return 1; //place other first
else //if both are emergency or both are not emergency
return this.getOrder()-other.getOrder(); //place smaller order first
}
//getters and setters
public int getOrder() {
return order;
}
public void setOrder(int order) {
this.order = order;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isEmergencyCase() {
return emergencyCase;
}
public void setEmergencyCase(boolean emergencyCase) {
this.emergencyCase = emergencyCase;
}
public String toString() {
return (isEmergencyCase()?\"*\":\"\") + name;
}
}
----------------------------------------------------------------------------
//PatientComparator.java
package A9.toStudents;
import java.util.Comparator;
public class PatientComparator implements Comparator
{
public int compare(Patient p1, Patient p2)
{
if(p1.isEmergencyCase() && !p2.isEmergencyCase())
return -1; //place p1 first
else if(!p1.isEmergencyCase() && p2.isEmergencyCase())
return 1; //place p2 first
else //if both are emergency or both are not emergency
return p1.getOrder()-p2.getOrder(); //place smaller order first
}
} //end of the PatientComparator
----------------------------------------------------------------------------
/*Sorter class contains static methods that take ArrayList
and sorts the list using bubble sort,insertion sort and
selection sort */
//Sorter.java
package A9.toStudents;
import java.util.ArrayList;
public class Sorter
{
//Bubble sort
public static void bubbleSort(ArrayList list)
{
for (int c = 0; c < ( list.size() - 1 ); c++)
{
for (int d = 0; d < list.size() - c - 1; d++)
{
if (list.get(d).compareTo(list.get(d+1))>0)
/* For ascending order*/
{
Patient temp= list.get(d);
list.set(d, list.get(d+1));
list.set(d+1, temp);
}
}
}
}
//Selection sort
public static void selectionSort(ArrayList list)
{
for (int i = 0; i < list.size() - 1; i++)
{
int index = i;
for (int j = i + 1; j < list.size(); j++)
if (list.get(j).compareTo(list.get(index))<0)
index = j;
Patient tempPatient = list.get(index);
list.set(index, list.get(i));
list.set(i,tempPatient);
}
}
//Insertion sort
public static void insertionSort(ArrayList list)
{
for (int i = 1; i < list.size(); i++)
{
for(int j = i ; j > 0 ; j--)
{
if(list.get(j).compareTo(list.get(j-1))<0)
{
Patient temp = list.get(j);
list.set(j,list.get(j-1));
list.set(j-1,temp);
}
}
}
}
public static void bubbleSort(ArrayList list,
PatientComparator patientComparator) {
for (int c = 0; c < ( list.s.
Ive already completed the Java assignment below, but it doesnt wor.pdffantasiatheoutofthef
I've already completed the Java assignment below, but it doesn't work. I will include my code
and the tests. Please correct my code and tests to that they match what has been asked and
reached 95% test coverage as asked for in the assignment.
Assignment: Disease File Repository
This assignment is a continuation of the last assignment. Please use the Eclipse project that you
created in the first assignment for this work.
Source Code
Class: Exposure
Copy the Exposure class from the previous assignment into the new. Make the necessary
changes so that this class can be serialized.
Class: Patient
Copy Patient class from the previous assignment into the new. Make the necessary changes so
that this class can be serialized and that it uses the Exposure class class.
Class: Disease
Copy the Disease, the InfectiousDisease, the NonInfectiousDisease classes from the previous
assignment into the new. Make the necessary changes so that they can be serialized.
Class: DiseaseAndPatient
Create a class called DiseaseAndPatient and define the follwing properties:
private Disease[] diseases;
private Patients[] patients;
Create getter and setter methods for the two arrays and document the new methods using the
Javadoc standard.
Class: DiseaseFileRepository
Create a class called DiseaseFileRepository and define the following methods:
DiseaseAndPatient init(String folderPath)
This method accepts a file path to the folder where the data was serialiaed and set the folder path
to a propert on this class. Deserialize the disease data from the file named diseases.dat.
Deserialize the patient data from the file named patients.fat. Set both the deserialized disease and
patient arrays to an instance of the DiseaseAndPatient class and return that instance. Throw an
IllegalArgumentException with an appropriate message if the supplied folder path is null.
void save(Disease[] diseases, Patient[] patients)
This method serializes and saves the supplied disease and patient array data to two separate files
on the file system using the folder path from the init method. Serialize the disease array data to a
file named disease.dat and the patient array data to the file name patients.dat.
Documentation
You are required to document the class, constructor, and methods using Javadoc standard.
Class: DiseaseFileRepositoryTest
Create a class called DiseaseFileRepositoryTest to test your DiseaseFileRespository class. You
must achieve at least 95% test coverage on the DiseaseFileRepository class.
Class: DiseaseControlManager and DiseaseControlManagerImpl
Copy the DiseaseControlManager interface and the DiseaseControlMangerImpl class from the
previous assignment and into the new. The DiseaseControlManager implementation will use the
DiseaseFileRepository class that you created in this assignment to initialize and save the disease
and patient data.
Constructor
Add a DiseaseFileRepository property to the DiseaseControlManager implementation and
initialize the property in the constructor of the D.
Define a class named Doctor whose objects are records for clinic’s d.pdfMALASADHNANI
Define a class named Doctor whose objects are records for clinic’s doctors. Derive this class
from the class Person given in listing 8. A Doctor record has the doctor’s name—defined in the
class Person—A specialty as a string (for example Pediatrician, Obstetrician, General
Practitioner, and so on), and office visit fee (use type double). Give your class has a reasonable
complement of constructors, accessor methods and an equals method as well. Write a driver
program to test all your methods.
this is the test file
modify this to make the test file work
Solution
//class doctor extended from person
class Doctor extends Person
{
//instnace variables
String specialty;
double fee;
//default construtor
public Doctor()
{
super();
specialty=\"\";
fee=0;
}
//parameterized contstructor with name as paratemetr
public Doctor(String n)
{
super(n);
specialty=\"\";
fee=0;
}
//constructor accepting name and specialty
public Doctor(String n,String s)
{
super(n);
specialty=s;
fee=0;
}
//constructor accepting name and fee
public Doctor(String n,double f)
{
super(n);
specialty=\"\";
fee=f;
}
//constructor accepting name,fee and specialy
public Doctor(String n,double f,String s)
{
super(n);
specialty=s;
fee=f;
}
//method to set variables for doctor
public void set(String n,double f,String s)
{
set(n);
specialty=s;
fee=f;
}
//setter for fee
public void setOfficeFee(double f)
{
fee=f;
}
//setter for spciality
public void setSpecialty(String s)
{
specialty=s;
}
//getter for speciality
public String getSpecialty()
{
return specialty;
}
//getter for fee
public double getOfficeFee()
{
return fee;
}
//set fee
public void writeOfficeFee()
{
fee=0;
}
//set specislity
public void writeSpecialty()
{
specialty=\"No specialty yet.\";
}
//compare two doctor objects
public boolean equals(Doctor d)
{
return hasSameName(d) && fee==d.fee && specialty.equals(d.specialty);
}
//display doctor detais
public void writeOutput()
{
super.writeOutput();
System.out.println(\"Speciality: \" +specialty);
System.out.println(\"Fee: \"+fee);
}
}
class Person
{
private String name;
public Person()
{
name = \"No name yet.\";
}
public Person(String initialName)
{
name = initialName;
}
public void setName(String newName)
{
name = newName;
}
public void set(String newName)
{
name = newName;
}
public void writeName()
{
name = \"No name yet.\";
}
public String getName()
{
return name;
}
public void writeOutput()
{
System.out.println(\"Name: \" + name);
}
public boolean hasSameName(Person otherPerson)
{
return (this.name.equalsIgnoreCase(otherPerson.getName()));
}
}
import java.util.*;
public class DoctorTest{
public static void main(String []args){
Scanner keyboard = new Scanner(System.in);
char repeat;
do // repeat if user says \'yes\'
{
// Test the six constructors (uses writeOutput method)
Doctor drNo = new Doctor();
System.out.println(\"Using default constructor:\");
System.out.println();
System.out.println(\"Verify:\");
System.out.println(\"No name yet.\");
System.out.println(\"$150\");
System.out.
i need help to edit the two methods below so that i can have them wo.pdfirshadoptical
I have to make a program for my C class and im stuck on the part where i have to calculate the
variance with elements from my array. This is exactly what im suppose to do:
Reset the sum variable to 0
Using another for loop (which needs its own loop variable), run through all valid elements of the
array, starting from index 0. Inside the loop:
Use the sum variable to accumulate the numerator of the variance formula shown on page 1.
After the end of this loop, compute the variance by dividing the new sum by the
dataElementsToProcess parameter.
this is the entire function
bool GenerateStatistics(FILE *fp2, double myArray[], int dataElementsToProcess)
{
if (fp2 == NULL && myArray == NULL && dataElementsToProcess < 1)
{
return false;
}
else
{
int i = 0,o = 0;
int sum = 0, sum1 = 0;
double maxValue = 0;
double minValue = DBL_MAX;
double mean, variance, stdDeviation;
for (int i = 0; i < 600; i++)
{
sum += myArray[i];
if (myArray[i] > maxValue)
{
maxValue = myArray[i];
}
if (myArray[i] < minValue)
{
minValue = myArray[i]; }
}
mean = sum / dataElementsToProcess;
sum = 0;
for (int o = 0; o < 600; o++)
{
sum += myArray[o];
}
variance = sqrt(pow((sum - mean), 2) / (dataElementsToProcess));
stdDeviation = sqrt(variance);
fprintf(fp2, \"Reaction Rate Statistics:\ \ \");
fprintf(fp2, \"Number of experiments = %d\ \", dataElementsToProcess);
fprintf(fp2, \"Minimum rate\\t\\t= %f\ \", minValue);
fprintf(fp2, \"Maximum rate\\t\\t= %f\ \", maxValue);
fprintf(fp2, \"Arithmetic mean\\t\\t= %f\ \", mean);
fprintf(fp2, \"Variance\\t\\t= %f\ \", variance);
fprintf(fp2, \"Standard deviation\\t= %f\ \ \ \", stdDeviation);
}
return true;
}
Solution
Here in the function you have
average - mean
Noofelements - dataElementsTo Process
Variance formula is
V = summation over i=1 to n ((xi - mean )*(xi - mean))
So perform like this using a for loop over my_array
double V=0.0
for(int i=0;i<600;i++)
{
V=V+pow((my_Array[i]-mean),2)
}
Now calculate standard deviation using sqrt of variance
sd=0.0
sd=sqrt(V).
Hello. Im creating a class called Bill. I need to design the class.pdfbarristeressaseren71
Hello. I\'m creating a class called Bill. I need to design the class Bill with data members to store
patient’s ID and the patient’s hospital charges such as pharmacy charges for medicine, and
doctor’s fee, and the room charges. And I need to add appropriate constructors and methods to
initialize, access, and manipulate the data members. I\'m struggling with this class. Thank you
for the help. I\'ll provide my current classes below.
Person.java
-----------
public class Person {
private String lastName;
private String firstName;
public Person(String last, String first)
{
this.lastName = last;
this.firstName = first;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String toString()
{
return lastName + \", \" + firstName;
}
}
---------------
Doctor.java
----------------
public class Doctor extends Person { // doctor class that inherits the person class
String Speciality;
public Doctor(String last, String first) { // constructor
super(last, first);
}
@Override
public String toString() { // method that return the data of the doctor
return \"Doctor{\" + \"Speciality=\" + Speciality + \'}\';
}
public String getSpeciality() {
return Speciality;
}
public void setSpeciality(String Speciality) {
this.Speciality = Speciality;
}
}
------------
Patient.java
------------
public class Patient extends Person{
private int PatientId;
private int age;
private Doctor attendingPhysician;
private Date dob;
private Date admitted,discharged;
public Patient(String firstName,String lastName,int PatientId,int age,Doctor
attendingPhysician,Date dob,Date admitted,Date discharged)
{
super(lastName,firstName);
this.PatientId = PatientId;
this.age = age;
this.admitted = admitted;
this.discharged = discharged;
this.dob = dob;
this.attendingPhysician = attendingPhysician;
}
public int getPatientId()
{
return PatientId;
}
public int getAge()
{
return age;
}
public Date getAdmissionDate()
{
return admitted;
}
public Date getDischargedDate()
{
return discharged;
}
public Date getDOB()
{
return dob;
}
public Doctor getPhysician()
{
return attendingPhysician;
}
public void setPatientId(int PatientId)
{
this.PatientId = PatientId;
}
public void setAge(int age)
{
this.age = age;
}
public void setAdmissionDate(Date admitted)
{
this.admitted = admitted;
}
public void setDischargedDate(Date discharged)
{
this.discharged = discharged;
}
public void setDOB(Date dob)
{
this.dob = dob;
}
public void setPhysician(Doctor attendingPhysician)
{
this.attendingPhysician = attendingPhysician;
}
}
------------
Date.java
--------------
public class Date {
private int year;
private int month;
private int day;
public Date()
{
year = 1900;
month = 1;
day = 1;
}
public Date(int y, int m, int d)
{
year = y;
month = m;
day = d;
}
public String toString()
{
return month + \"/\" + day + \"/\" + year;
}
pu.
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Demo {
static Scanner scanner=new Scanner(System.in);
public static void main(String[] args) {
ListnameList=createListOfNames();
try {
// Declare variable for user\'s option
int menuOption = 0;
do {
// Setting menuOption equal to return value from showMenu() function;
menuOption = showMenu();
// switch case as per the user option
switch (menuOption) {
case 1:
int correctAnswer=hardProblem(nameList);
System.out.println(\"Correct Answer :\"+correctAnswer);
break;
case 2:
int correctAnswerEasy=easyProblem(nameList);
System.out.println(\"Correct Answer :\"+correctAnswerEasy);
break;
case 3:
System.out.println(\"Quitting Program..\");
break;
default:
System.out.println(\"Sorry, Please enter valid Option\");
}// End of switch statement
} while (menuOption != 3);
} catch (Exception ex) {
// Error Message
System.out.println(\"Sorry problem occured within Program\");
// flushing scanner
scanner.next();
} finally {
// Ensuring that scanner will always be closed and cleaning up
// resources
scanner.close();
}
}// End of main Method
/**
* Method that prints menu to screen and gets returns user\'s option from menu
* @return Returns user Option
*/
public static int showMenu() {
// Declaring var for user option and defaulting to 0
int option = 0;
// Printing menu to screen
System.out.println(\"Menu:\");
System.out.println(\"1.Hard Problem\");
System.out.println(\"2.Easy Problem\");
System.out.println(\"3. Quit\");
// Getting user option from above menu
System.out.println(\"Enter Option from above...\");
option = scanner.nextInt();
return option;
}
public static ListcreateListOfNames(){
ListnameList=new ArrayList();
System.out.println(\"Enter the number of children to enter\");
int num=scanner.nextInt();
for(int i=0;inameList){
int correctAnswers=0;
int day=0;
for(String name:nameList){
boolean correct=false;
int index=day%nameList.size();
String childForDishDuty=nameList.get(index);
System.out.println(\"Please enter the child name\");
String userInput=scanner.next();
if(childForDishDuty.equalsIgnoreCase(userInput)){
correct=true;
}
if(correct){
correctAnswers++;
}
day++;
}
return correctAnswers;
}
public static int easyProblem(ListnameList){
int correctAnswers=0;
int day=0;
for(String name:nameList){
boolean correct=false;
int index=day%nameList.size();
String childForDishDuty=\"Day \"+day+\":\"+nameList.get(index)+\" must do the
dishes\";
System.out.println(childForDishDuty);
System.out.println(\"Please enter the child name\");
String userInput=scanner.next();
if(nameList.get(index).equalsIgnoreCase(userInput)){
correct=true;
}
if(correct){
correctAnswers++;
}
day++;
}
return correctAnswers;
}
}
Solution
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Demo {
static Scanner scanner=new Scanner(System.in);
public static void main(String[] args) {
ListnameList=createListOfNames();
try {
// Declare variable for user\'s option
int .
package s3; Copy paste this Java Template and save it as Emer.pdfarakalamkah11
package s3;
// Copy paste this Java Template and save it as \"EmergencyRoom.java\"
import java.util.*;
import java.io.*;
// write your matric number here:
// write your name here:
// write list of collaborators here:
// year 2016 hash code: XAbyuzR78fXeaMHBdLan (do NOT delete this line)
class patientlist {
private String PatientName;
private int emergencyLvl;
public patientlist(String PatientName, int emergencyLvl) {
this.PatientName = PatientName;
this.emergencyLvl = emergencyLvl;
}
public String getPatientName() {
return PatientName;
}
public void setPatientName(String PatientName) {
this.PatientName = PatientName;
}
public int getEmergencyLvl() {
return emergencyLvl;
}
public void setEmergencyLvl(int emergencyLvl) {
this.emergencyLvl = emergencyLvl;
}
}
class EmergencyRoom {
// if needed, declare a private data structure here that
// is accessible to all methods in this class
private List patientlist;
public EmergencyRoom() {
// Write necessary code during construction
patientlist = new ArrayList();
}
void ArriveAtHospital(String patientName, int emergencyLvl) {
// You have to insert the information (patientName, emergencyLvl)
// into your chosen data structure
if (patientName.length() > 15 || patientName.length() < 1) {
System.out.println(\"patient name is either too long or too short.\ Please enter a name between 1
to 15 characters.\");
} else if (emergencyLvl > 100 || emergencyLvl < 30) {
System.out.println(\"Emergency level is either too high or too low.\ Please enter a valid level
between 30 to 100.\");
} else {
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
System.out.println(\"Patient already admitted\");
break;
}
}
if (i == patientlist.size()) {
patientlist p = new patientlist(patientName.toUpperCase(), emergencyLvl);
patientlist.add(p);
}
}
}
void UpdateEmergencyLvl(String patientName, int incEmergencyLvl) {
// You have to update the emergencyLvl of patientName to
// emergencyLvl += incEmergencyLvl
// and modify your chosen data structure (if needed)
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
//System.out.println(\"Patient already admitted\");
//break;
if (incEmergencyLvl > 70 || incEmergencyLvl < 0) {
System.out.println(\"Emergency level is either too high or too low.\ Please enter a valid
increment between 0 to 70.\");
break;
} else {
patientlist.get(i).setEmergencyLvl(patientlist.get(i).getEmergencyLvl() + incEmergencyLvl);
}
}
}
}
void Treat(String patientName) {
// This patientName is treated by the doctor
// remove him/her from your chosen data structure
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
patientlist.remove(i);
}
}
}
String Query() {
String ans = \"The emergency room is empty\";
int i;
if(patientlist.isEmpty())
return ans;
else{
int max=patientlist.get(0).getEme.
How to fix these erros The method sortListltTgt in the.pdfshahidipen68
How to fix these erros
The method sort(List<T>) in the type Collections is not applicable for the arguments
(ArrayList<ApprovedPerson>)
The method sort(List<T>) in the type Collections is not applicable for the arguments
(ArrayList<VaccineBatch>)
import java.io.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.stream.IntStream;
public class VaxProgram {
private ArrayList<Person> plist = new ArrayList<Person>();
private ArrayList<ApprovedPerson> aplist = new ArrayList<ApprovedPerson>();
private ArrayList<VaccineBatch> vblist = new ArrayList<VaccineBatch>();
private ArrayList<FullyVaccinatedPerson> fvlist = new ArrayList<FullyVaccinatedPerson>();
private int initApproved;
/*
vx.loadPersons("persons.txt");
ArrayList<ApprovedPerson> aplist = vx.loadApproved(plist, "approved.txt");
int initApproved = aplist.size();
ArrayList<VaccineBatch> vblist = vx.loadVcBatches("vcbatches.txt");
//3
//3. savdvclist
ArrayList<FullyVaccinatedPerson> fvlist = vx.applyVaxes(aplist, vblist);
*/
public void clearData() {
plist.clear();
aplist.clear();
vblist.clear();
fvlist.clear();
Person.resetId();
}
public ArrayList<Person> loadPersons(String pfile) {
Scanner pscan = null;
ArrayList<Person> plist = new ArrayList<Person>();
try {
pscan = new Scanner(new File(pfile));
while (pscan.hasNext()) {
String[] nextLine = pscan.nextLine().split(" ");
String name = nextLine[0] + " " + nextLine[1];
int age = Integer.parseInt(nextLine[2]);
boolean publish = false;
if (nextLine[3].equals("0"))
publish = false;
else
publish = true;
Person p = new Person(name, age, publish);
plist.add(p);
}
pscan.close();
} catch (IOException e) {
}
return plist;
}
public void loadApproved(String afile) {
final var fileName = "src/cases/" + afile.split("cases/")[1];
try (final var apscan = new Scanner(new File(fileName))) {
while (apscan.hasNext()) {
String apLine = apscan.nextLine();
String[] nextLine = apLine.split(" ");
int id = Integer.parseInt(nextLine[0]);
int foundpos = findPerson(plist, id);//.indexOf(id);//***
if (foundpos >= 0) {
ApprovedPerson ap = new ApprovedPerson(plist.get(foundpos).getAge(),
plist.get(foundpos).getName(), plist.get(foundpos).getPublish(),
plist.get(foundpos).getId());
for (int i = 1; i < nextLine.length; i++)
ap.addComorbidity(nextLine[i]);
aplist.add(ap);
plist.remove(foundpos);
}
}
} catch (FileNotFoundException e) {
System.out.println("There was no file with the name: " + fileName);
}
}
public ArrayList<VaccineBatch> loadVCBatches(String vcfile) throws IOException,
ArrayIndexOutOfBoundsException {
final var fileName = "src/cases/" + vcfile.split("cases/")[1];
Scanner vscan = new Scanner(new File(fileName));
ArrayList<VaccineBatch> vlist = new ArrayList<>();
while (vscan.hasNext()) {
final var fileLine = vscan.nextLine().split("t");
vlist.add(new VaccineBatch(
fileLine[0],
Integer.parseInt(fileLine[1]),
Integer.parseInt(fileLine[3]).
write a java program to accept the names of three items and their pric.docxlez31palka
write a java program to accept the names of three items and their prices from the user and outputs them and the average price to the message box
Solution
import java.util.SortedSet;
import java.util.TreeSet;
import javax.swing.JOptionPane;
import javax.swing.JFrame;
class Average {
public static void main(String [] args) {
String item1= JOptionPane.showInputDialog(\"Please input item1 price: \");
String item2= JOptionPane.showInputDialog(\"Please input item2 price: \");
String item3= JOptionPane.showInputDialog(\"Please input item4 price: \");
int int1 = Integer.parseInt(item1);
int int2 = Integer.parseInt(item2);
int int3 = Integer.parseInt(item3);
SortedSet<Integer> set = new TreeSet<>();
set.add(int1);
set.add(int2);
set.add(int3);
Integer [] intArray = set.toArray(new Integer[3]);
JFrame frame = new JFrame();
JOptionPane.showInternalMessageDialog(frame.getContentPane(), String.format(\"Result %f\", (intArray[0]+intArray[1] + intArray[2]) / 3.0));
}
}
.
Objective Min-heap queue with customized comparatorHospital emerg.pdfezhilvizhiyan
Objective: Min-heap queue with customized comparator
Hospital emergency room assign patient priority base on symptom of the patient. Each patient
receives an identity number which prioritizes the order of emergency for the patient. The lower
the number is, the higher the emergency will be.
Use java.util.PriorityQueue to write a java program to create the emergency room registration
database. The patient.txt is the input file for patient record. Download patient.txt, Patient.java to
perform following specifications:
(a)Load all records from the input file.
(b)At the end, print the list in assigned priority order.
Given Code:
//*******************************************************************
// Patient.java
//*******************************************************************
public class Patient
{
private int id;
private String name;
private String emergencyCase;
//----------------------------------------------------------------
// Creates a customer with the specified id number.
//----------------------------------------------------------------
public Patient (int number, String custName,String er )
{
id = number;
name = custName;
emergencyCase = er;
}
//----------------------------------------------------------------
// Returns a string description of this customer.
//----------------------------------------------------------------
public String toString()
{
return \"Patient priority id: \" + id+\" Patient name: \"+name+\" Symptom: \"+emergencyCase;
}
public String getName()
{
return name;
}
public int getId()
{
return id;
}
public String getCase()
{
return emergencyCase;
}
}
/** Source code example for \"A Practical Introduction to Data
Structures and Algorithm Analysis, 3rd Edition (Java)\"
by Clifford A. Shaffer
Copyright 2008-2011 by Clifford A. Shaffer
*/
import java.util.*;
import java.math.*;
/** A bunch of utility functions. */
class DSutil {
/** Swap two Objects in an array
@param A The array
@param p1 Index of one Object in A
@param p2 Index of another Object A
*/
public static void swap(E[] A, int p1, int p2) {
E temp = A[p1];
A[p1] = A[p2];
A[p2] = temp;
}
/** Randomly permute the Objects in an array.
@param A The array
*/
// int version
// Randomly permute the values of array \"A\"
static void permute(int[] A) {
for (int i = A.length; i > 0; i--) // for each i
swap(A, i-1, DSutil.random(i)); // swap A[i-1] with
} // a random element
public static void swap(int[] A, int p1, int p2) {
int temp = A[p1];
A[p1] = A[p2];
A[p2] = temp;
}
/** Randomly permute the values in array A */
static void permute(E[] A) {
for (int i = A.length; i > 0; i--) // for each i
swap(A, i-1, DSutil.random(i)); // swap A[i-1] with
} // a random element
/** Initialize the random variable */
static private Random value = new Random(); // Hold the Random class object
/** Create a random number function from the standard Java Random
class. Turn it into a uniformly distributed value within the
range 0 to n-1 by taking the value mod n.
@param n The upper boun.
Object- objects have states and behaviors. Example: A dog has states-color, name, breed , as well as behaviors – barking, eating. An object is an instance of a class.
Class- A class can be defined as a template/blue print that describe the behavior/states that object of its type support.
C, D, and E are wrong and involve random constants. Thisnarrows it d.pdfarasanlethers
C, D, and E are wrong and involve random constants. Thisnarrows it down to A and B; it is A
because the negative sign meansthat energy is being given off when it (SO2) forms.
I hope you found this helpful, please rate! :)
I hope you found this helpful, please rate! :)
Solution
C, D, and E are wrong and involve random constants. Thisnarrows it down to A and B; it is A
because the negative sign meansthat energy is being given off when it (SO2) forms.
I hope you found this helpful, please rate! :)
I hope you found this helpful, please rate! :).
More Related Content
Similar to Here is how the code works1. Patient.java is an Abstract Class whi.pdf
Hello. Im creating a class called Bill. I need to design the class.pdfbarristeressaseren71
Hello. I\'m creating a class called Bill. I need to design the class Bill with data members to store
patient’s ID and the patient’s hospital charges such as pharmacy charges for medicine, and
doctor’s fee, and the room charges. And I need to add appropriate constructors and methods to
initialize, access, and manipulate the data members. I\'m struggling with this class. Thank you
for the help. I\'ll provide my current classes below.
Person.java
-----------
public class Person {
private String lastName;
private String firstName;
public Person(String last, String first)
{
this.lastName = last;
this.firstName = first;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String toString()
{
return lastName + \", \" + firstName;
}
}
---------------
Doctor.java
----------------
public class Doctor extends Person { // doctor class that inherits the person class
String Speciality;
public Doctor(String last, String first) { // constructor
super(last, first);
}
@Override
public String toString() { // method that return the data of the doctor
return \"Doctor{\" + \"Speciality=\" + Speciality + \'}\';
}
public String getSpeciality() {
return Speciality;
}
public void setSpeciality(String Speciality) {
this.Speciality = Speciality;
}
}
------------
Patient.java
------------
public class Patient extends Person{
private int PatientId;
private int age;
private Doctor attendingPhysician;
private Date dob;
private Date admitted,discharged;
public Patient(String firstName,String lastName,int PatientId,int age,Doctor
attendingPhysician,Date dob,Date admitted,Date discharged)
{
super(lastName,firstName);
this.PatientId = PatientId;
this.age = age;
this.admitted = admitted;
this.discharged = discharged;
this.dob = dob;
this.attendingPhysician = attendingPhysician;
}
public int getPatientId()
{
return PatientId;
}
public int getAge()
{
return age;
}
public Date getAdmissionDate()
{
return admitted;
}
public Date getDischargedDate()
{
return discharged;
}
public Date getDOB()
{
return dob;
}
public Doctor getPhysician()
{
return attendingPhysician;
}
public void setPatientId(int PatientId)
{
this.PatientId = PatientId;
}
public void setAge(int age)
{
this.age = age;
}
public void setAdmissionDate(Date admitted)
{
this.admitted = admitted;
}
public void setDischargedDate(Date discharged)
{
this.discharged = discharged;
}
public void setDOB(Date dob)
{
this.dob = dob;
}
public void setPhysician(Doctor attendingPhysician)
{
this.attendingPhysician = attendingPhysician;
}
}
------------
Date.java
--------------
public class Date {
private int year;
private int month;
private int day;
public Date()
{
year = 1900;
month = 1;
day = 1;
}
public Date(int y, int m, int d)
{
year = y;
month = m;
day = d;
}
public String toString()
{
return month + \"/\" + day + \"/\" + year;
}
pu.
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Demo {
static Scanner scanner=new Scanner(System.in);
public static void main(String[] args) {
ListnameList=createListOfNames();
try {
// Declare variable for user\'s option
int menuOption = 0;
do {
// Setting menuOption equal to return value from showMenu() function;
menuOption = showMenu();
// switch case as per the user option
switch (menuOption) {
case 1:
int correctAnswer=hardProblem(nameList);
System.out.println(\"Correct Answer :\"+correctAnswer);
break;
case 2:
int correctAnswerEasy=easyProblem(nameList);
System.out.println(\"Correct Answer :\"+correctAnswerEasy);
break;
case 3:
System.out.println(\"Quitting Program..\");
break;
default:
System.out.println(\"Sorry, Please enter valid Option\");
}// End of switch statement
} while (menuOption != 3);
} catch (Exception ex) {
// Error Message
System.out.println(\"Sorry problem occured within Program\");
// flushing scanner
scanner.next();
} finally {
// Ensuring that scanner will always be closed and cleaning up
// resources
scanner.close();
}
}// End of main Method
/**
* Method that prints menu to screen and gets returns user\'s option from menu
* @return Returns user Option
*/
public static int showMenu() {
// Declaring var for user option and defaulting to 0
int option = 0;
// Printing menu to screen
System.out.println(\"Menu:\");
System.out.println(\"1.Hard Problem\");
System.out.println(\"2.Easy Problem\");
System.out.println(\"3. Quit\");
// Getting user option from above menu
System.out.println(\"Enter Option from above...\");
option = scanner.nextInt();
return option;
}
public static ListcreateListOfNames(){
ListnameList=new ArrayList();
System.out.println(\"Enter the number of children to enter\");
int num=scanner.nextInt();
for(int i=0;inameList){
int correctAnswers=0;
int day=0;
for(String name:nameList){
boolean correct=false;
int index=day%nameList.size();
String childForDishDuty=nameList.get(index);
System.out.println(\"Please enter the child name\");
String userInput=scanner.next();
if(childForDishDuty.equalsIgnoreCase(userInput)){
correct=true;
}
if(correct){
correctAnswers++;
}
day++;
}
return correctAnswers;
}
public static int easyProblem(ListnameList){
int correctAnswers=0;
int day=0;
for(String name:nameList){
boolean correct=false;
int index=day%nameList.size();
String childForDishDuty=\"Day \"+day+\":\"+nameList.get(index)+\" must do the
dishes\";
System.out.println(childForDishDuty);
System.out.println(\"Please enter the child name\");
String userInput=scanner.next();
if(nameList.get(index).equalsIgnoreCase(userInput)){
correct=true;
}
if(correct){
correctAnswers++;
}
day++;
}
return correctAnswers;
}
}
Solution
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Demo {
static Scanner scanner=new Scanner(System.in);
public static void main(String[] args) {
ListnameList=createListOfNames();
try {
// Declare variable for user\'s option
int .
package s3; Copy paste this Java Template and save it as Emer.pdfarakalamkah11
package s3;
// Copy paste this Java Template and save it as \"EmergencyRoom.java\"
import java.util.*;
import java.io.*;
// write your matric number here:
// write your name here:
// write list of collaborators here:
// year 2016 hash code: XAbyuzR78fXeaMHBdLan (do NOT delete this line)
class patientlist {
private String PatientName;
private int emergencyLvl;
public patientlist(String PatientName, int emergencyLvl) {
this.PatientName = PatientName;
this.emergencyLvl = emergencyLvl;
}
public String getPatientName() {
return PatientName;
}
public void setPatientName(String PatientName) {
this.PatientName = PatientName;
}
public int getEmergencyLvl() {
return emergencyLvl;
}
public void setEmergencyLvl(int emergencyLvl) {
this.emergencyLvl = emergencyLvl;
}
}
class EmergencyRoom {
// if needed, declare a private data structure here that
// is accessible to all methods in this class
private List patientlist;
public EmergencyRoom() {
// Write necessary code during construction
patientlist = new ArrayList();
}
void ArriveAtHospital(String patientName, int emergencyLvl) {
// You have to insert the information (patientName, emergencyLvl)
// into your chosen data structure
if (patientName.length() > 15 || patientName.length() < 1) {
System.out.println(\"patient name is either too long or too short.\ Please enter a name between 1
to 15 characters.\");
} else if (emergencyLvl > 100 || emergencyLvl < 30) {
System.out.println(\"Emergency level is either too high or too low.\ Please enter a valid level
between 30 to 100.\");
} else {
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
System.out.println(\"Patient already admitted\");
break;
}
}
if (i == patientlist.size()) {
patientlist p = new patientlist(patientName.toUpperCase(), emergencyLvl);
patientlist.add(p);
}
}
}
void UpdateEmergencyLvl(String patientName, int incEmergencyLvl) {
// You have to update the emergencyLvl of patientName to
// emergencyLvl += incEmergencyLvl
// and modify your chosen data structure (if needed)
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
//System.out.println(\"Patient already admitted\");
//break;
if (incEmergencyLvl > 70 || incEmergencyLvl < 0) {
System.out.println(\"Emergency level is either too high or too low.\ Please enter a valid
increment between 0 to 70.\");
break;
} else {
patientlist.get(i).setEmergencyLvl(patientlist.get(i).getEmergencyLvl() + incEmergencyLvl);
}
}
}
}
void Treat(String patientName) {
// This patientName is treated by the doctor
// remove him/her from your chosen data structure
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
patientlist.remove(i);
}
}
}
String Query() {
String ans = \"The emergency room is empty\";
int i;
if(patientlist.isEmpty())
return ans;
else{
int max=patientlist.get(0).getEme.
How to fix these erros The method sortListltTgt in the.pdfshahidipen68
How to fix these erros
The method sort(List<T>) in the type Collections is not applicable for the arguments
(ArrayList<ApprovedPerson>)
The method sort(List<T>) in the type Collections is not applicable for the arguments
(ArrayList<VaccineBatch>)
import java.io.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.stream.IntStream;
public class VaxProgram {
private ArrayList<Person> plist = new ArrayList<Person>();
private ArrayList<ApprovedPerson> aplist = new ArrayList<ApprovedPerson>();
private ArrayList<VaccineBatch> vblist = new ArrayList<VaccineBatch>();
private ArrayList<FullyVaccinatedPerson> fvlist = new ArrayList<FullyVaccinatedPerson>();
private int initApproved;
/*
vx.loadPersons("persons.txt");
ArrayList<ApprovedPerson> aplist = vx.loadApproved(plist, "approved.txt");
int initApproved = aplist.size();
ArrayList<VaccineBatch> vblist = vx.loadVcBatches("vcbatches.txt");
//3
//3. savdvclist
ArrayList<FullyVaccinatedPerson> fvlist = vx.applyVaxes(aplist, vblist);
*/
public void clearData() {
plist.clear();
aplist.clear();
vblist.clear();
fvlist.clear();
Person.resetId();
}
public ArrayList<Person> loadPersons(String pfile) {
Scanner pscan = null;
ArrayList<Person> plist = new ArrayList<Person>();
try {
pscan = new Scanner(new File(pfile));
while (pscan.hasNext()) {
String[] nextLine = pscan.nextLine().split(" ");
String name = nextLine[0] + " " + nextLine[1];
int age = Integer.parseInt(nextLine[2]);
boolean publish = false;
if (nextLine[3].equals("0"))
publish = false;
else
publish = true;
Person p = new Person(name, age, publish);
plist.add(p);
}
pscan.close();
} catch (IOException e) {
}
return plist;
}
public void loadApproved(String afile) {
final var fileName = "src/cases/" + afile.split("cases/")[1];
try (final var apscan = new Scanner(new File(fileName))) {
while (apscan.hasNext()) {
String apLine = apscan.nextLine();
String[] nextLine = apLine.split(" ");
int id = Integer.parseInt(nextLine[0]);
int foundpos = findPerson(plist, id);//.indexOf(id);//***
if (foundpos >= 0) {
ApprovedPerson ap = new ApprovedPerson(plist.get(foundpos).getAge(),
plist.get(foundpos).getName(), plist.get(foundpos).getPublish(),
plist.get(foundpos).getId());
for (int i = 1; i < nextLine.length; i++)
ap.addComorbidity(nextLine[i]);
aplist.add(ap);
plist.remove(foundpos);
}
}
} catch (FileNotFoundException e) {
System.out.println("There was no file with the name: " + fileName);
}
}
public ArrayList<VaccineBatch> loadVCBatches(String vcfile) throws IOException,
ArrayIndexOutOfBoundsException {
final var fileName = "src/cases/" + vcfile.split("cases/")[1];
Scanner vscan = new Scanner(new File(fileName));
ArrayList<VaccineBatch> vlist = new ArrayList<>();
while (vscan.hasNext()) {
final var fileLine = vscan.nextLine().split("t");
vlist.add(new VaccineBatch(
fileLine[0],
Integer.parseInt(fileLine[1]),
Integer.parseInt(fileLine[3]).
write a java program to accept the names of three items and their pric.docxlez31palka
write a java program to accept the names of three items and their prices from the user and outputs them and the average price to the message box
Solution
import java.util.SortedSet;
import java.util.TreeSet;
import javax.swing.JOptionPane;
import javax.swing.JFrame;
class Average {
public static void main(String [] args) {
String item1= JOptionPane.showInputDialog(\"Please input item1 price: \");
String item2= JOptionPane.showInputDialog(\"Please input item2 price: \");
String item3= JOptionPane.showInputDialog(\"Please input item4 price: \");
int int1 = Integer.parseInt(item1);
int int2 = Integer.parseInt(item2);
int int3 = Integer.parseInt(item3);
SortedSet<Integer> set = new TreeSet<>();
set.add(int1);
set.add(int2);
set.add(int3);
Integer [] intArray = set.toArray(new Integer[3]);
JFrame frame = new JFrame();
JOptionPane.showInternalMessageDialog(frame.getContentPane(), String.format(\"Result %f\", (intArray[0]+intArray[1] + intArray[2]) / 3.0));
}
}
.
Objective Min-heap queue with customized comparatorHospital emerg.pdfezhilvizhiyan
Objective: Min-heap queue with customized comparator
Hospital emergency room assign patient priority base on symptom of the patient. Each patient
receives an identity number which prioritizes the order of emergency for the patient. The lower
the number is, the higher the emergency will be.
Use java.util.PriorityQueue to write a java program to create the emergency room registration
database. The patient.txt is the input file for patient record. Download patient.txt, Patient.java to
perform following specifications:
(a)Load all records from the input file.
(b)At the end, print the list in assigned priority order.
Given Code:
//*******************************************************************
// Patient.java
//*******************************************************************
public class Patient
{
private int id;
private String name;
private String emergencyCase;
//----------------------------------------------------------------
// Creates a customer with the specified id number.
//----------------------------------------------------------------
public Patient (int number, String custName,String er )
{
id = number;
name = custName;
emergencyCase = er;
}
//----------------------------------------------------------------
// Returns a string description of this customer.
//----------------------------------------------------------------
public String toString()
{
return \"Patient priority id: \" + id+\" Patient name: \"+name+\" Symptom: \"+emergencyCase;
}
public String getName()
{
return name;
}
public int getId()
{
return id;
}
public String getCase()
{
return emergencyCase;
}
}
/** Source code example for \"A Practical Introduction to Data
Structures and Algorithm Analysis, 3rd Edition (Java)\"
by Clifford A. Shaffer
Copyright 2008-2011 by Clifford A. Shaffer
*/
import java.util.*;
import java.math.*;
/** A bunch of utility functions. */
class DSutil {
/** Swap two Objects in an array
@param A The array
@param p1 Index of one Object in A
@param p2 Index of another Object A
*/
public static void swap(E[] A, int p1, int p2) {
E temp = A[p1];
A[p1] = A[p2];
A[p2] = temp;
}
/** Randomly permute the Objects in an array.
@param A The array
*/
// int version
// Randomly permute the values of array \"A\"
static void permute(int[] A) {
for (int i = A.length; i > 0; i--) // for each i
swap(A, i-1, DSutil.random(i)); // swap A[i-1] with
} // a random element
public static void swap(int[] A, int p1, int p2) {
int temp = A[p1];
A[p1] = A[p2];
A[p2] = temp;
}
/** Randomly permute the values in array A */
static void permute(E[] A) {
for (int i = A.length; i > 0; i--) // for each i
swap(A, i-1, DSutil.random(i)); // swap A[i-1] with
} // a random element
/** Initialize the random variable */
static private Random value = new Random(); // Hold the Random class object
/** Create a random number function from the standard Java Random
class. Turn it into a uniformly distributed value within the
range 0 to n-1 by taking the value mod n.
@param n The upper boun.
Object- objects have states and behaviors. Example: A dog has states-color, name, breed , as well as behaviors – barking, eating. An object is an instance of a class.
Class- A class can be defined as a template/blue print that describe the behavior/states that object of its type support.
C, D, and E are wrong and involve random constants. Thisnarrows it d.pdfarasanlethers
C, D, and E are wrong and involve random constants. Thisnarrows it down to A and B; it is A
because the negative sign meansthat energy is being given off when it (SO2) forms.
I hope you found this helpful, please rate! :)
I hope you found this helpful, please rate! :)
Solution
C, D, and E are wrong and involve random constants. Thisnarrows it down to A and B; it is A
because the negative sign meansthat energy is being given off when it (SO2) forms.
I hope you found this helpful, please rate! :)
I hope you found this helpful, please rate! :).
AnswerOogenesis is the process by which ovum mother cells or oogo.pdfarasanlethers
Answer:
Oogenesis is the process by which ovum mother cells or oogonia gives rise to mature ovum- the
female gametes. The process takes place in the outermost layer- the germinal epithelium of the
ovary.
Meiotic Events in oogenesis:
Initially before birth, the oogonium undergoes mitotic divisions so as to increase its number. This
process takes place during the embryonic growth phase. No further addition to this number takes
place after birth. In the human embryo, the thousand or so oogonia divide rapidly from the
second to the seventh month of gestation to form roughly 7 million germ cells. After the seventh
month though, there is a sharp decline in the number of these newly formed cells. These
remaining cells are the ones entering the reductional division of meiosis (meiosis-1). These cells
enters into meiosis-1 but they are unable to advance through Prophase-1 of meiosis. These cells
are arrested in the diplotene sub-stage of Prophase-1 and they are maintained at this stage until
puberty. These cells are now known as primary oocytes. Even the primary oocytes continue to
die during this phase. Roughly only about 400 oocytes mature during the reproductive life of a
female periodically. At the onset of puberty, specific hormonal cues re-initiate the process of
meiosis.
During adolescence, the GnRH or gonadotropin releasing hormones released from the
hypothalamus signals the anterior pituitary to release hormones like LH & FSH which lifts the
cell cycle arrest in these cells and assists them in resuming meiosis. The primary oocytes
completes meiosis-1 and gives rise to a tiny polar body and another larger secondary oocyte with
greater content of cytoplasm ( unequal cell division). In some organisms , the polar bodies may
again divide to form 2 polar bodies while it dies off in case of humans. The secondary oocyte
thus produced advances through Meiosis-2 ( equational division) but halts at meiosis-2. The
secondary oocyte is released from the follicle and it travels towards the fallopian tube. The
immature secondary oocyte can re-enter cell cycle and complete the remaining sub-stages of
meiosis-2 only if union with a sperm takes place. The secondary oocyte progresses through
meiosis-2 giving rise to another polar body and a female pro-nucleus which unites with the
sperm and gives rise to the zygote or the fertilized egg. Thus begins the process of embryonic
development.
Developmental process in oogenesis:
Oogonia are formed from the primoridial germ cells of the ovary by mitotic cell division. By
growth & maturation oogonia increase in size and become primary oocytes. During this phase,
synthesis of food and factors required for further differentiation are synthesized. During the
growth phase, the primary oocytes gets surrounded by specialized cells of the ovary known as
follicle cells. Once they are fully formed, cavities are formed and these gets filled with their own
secretion. At this stage, it is known as Graafian follicle. Oocyte collects .
AnswerB) S. typhimuium gains access to the host by crossing the.pdfarasanlethers
Answer:
B) S. typhimuium gains access to the host by crossing the intestinal epithelium inside M cells
The M cells are found in the gut-associated lymphoid tissue (GALT) of the Peyer\'s patches and
in the mucosa-associated lymphoid tissue (MALT) of other parts of the gastrointestinal tract.
These cells are known to initiate mucosal immunityresponses on the apical membrane of the M
cells and allow for transport of microbes and particles across the epithelial cell layer from the gut
lumen to the lamina propria where interactions with immune cells can take place. M cells have
the unique ability to take up antigen from the lumen of the small intestine via endocytosis,
phagocytosis, or transcytosis.
Solution
Answer:
B) S. typhimuium gains access to the host by crossing the intestinal epithelium inside M cells
The M cells are found in the gut-associated lymphoid tissue (GALT) of the Peyer\'s patches and
in the mucosa-associated lymphoid tissue (MALT) of other parts of the gastrointestinal tract.
These cells are known to initiate mucosal immunityresponses on the apical membrane of the M
cells and allow for transport of microbes and particles across the epithelial cell layer from the gut
lumen to the lamina propria where interactions with immune cells can take place. M cells have
the unique ability to take up antigen from the lumen of the small intestine via endocytosis,
phagocytosis, or transcytosis..
Answer question1,2,4,5Ion–dipole interactionsAffinity of oxygen .pdfarasanlethers
Answer question
1,2,4,5Ion–dipole interactionsAffinity of oxygen towards cationsDipole–dipole
interactionsHydrationAffinity of hydrogen towards anionsHydrogen bonding
Solution
Answer question
1,2,4,5Ion–dipole interactionsAffinity of oxygen towards cationsDipole–dipole
interactionsHydrationAffinity of hydrogen towards anionsHydrogen bonding.
A Letter to myself!Hi to myself!Now that I am an Engineer with a.pdfarasanlethers
A Letter to myself!
Hi to myself!
Now that I am an Engineer with a certified degree, as an Engineer I aspire to do some wonderful
things for myself and society. As I studied the Civil Engineering and about the wonders that it
has created for the well being of the society and the world, it amused me and inpired me to
become an Engineer. I want to design the bridges, tunnels, skyscrappers and dams which
wouldn\'t fail and please to the eyes. In history we have seen the engineering disasters such as
the Tacoma Washington bridge disaster, in which the wind loads were ignored while designing.
We learned from such disasters and improved our bridge by incorporating the wind and other
loads such as earthquake loads. There has been a revolution in the Civil Engineering field since
the advent of the cement and reinforced concrete. Initially we could only design low strength
concrete but now with the help of the admixtures and air-entraining agents we can design a mix
of strength greater than 70 MPa.
Empire State Building was constructed in 1932 and remained the tallest skyscraper till 1967,
until we learn to create the taller structures. Now we know that Burj Khalifa is the tallest
standing structure in the world with a height almost double of that of Empire state building.
Empire state building is now at 9th in the ranking of the tallest structure. Similarl trends can be
observed in the design of the bridges, tunnels and dams.
What we learn from all this history is that, there is never a full stop to the impovement of the
design of the structures. In present world, we still have many problems, such as the
environmental issues related with the use and production of the cement, which is responsible for
the production of a large proportion of the green house gases. There is a need to find the better
alternative of the cement. We still can\'t construct the earthquake proof buildings, and there
always will be a need for improvement in this field. More than one million people die each year
in the road crashes, many of which occur due to the poor design and construction, there is a need
of the better Intelligent Traffic Systems(ITS.)
I see that there is a lot to be improved in the current engineering field, so I will find the best
opportunity to serve my techniques and skills to work in any of the abovementioned fields.
Thank You!
Solution
A Letter to myself!
Hi to myself!
Now that I am an Engineer with a certified degree, as an Engineer I aspire to do some wonderful
things for myself and society. As I studied the Civil Engineering and about the wonders that it
has created for the well being of the society and the world, it amused me and inpired me to
become an Engineer. I want to design the bridges, tunnels, skyscrappers and dams which
wouldn\'t fail and please to the eyes. In history we have seen the engineering disasters such as
the Tacoma Washington bridge disaster, in which the wind loads were ignored while designing.
We learned from such disasters and .
Particulars Amount ($) Millons a) Purchase consideratio.pdfarasanlethers
Particulars Amount ($) Millons a) Purchase consideration paid 6.3 b) Net Assets
Aquired: Land 1.2 Buildings 2.9 Inventory 1.7 Liabilities -1 4.8 (a) - (b)
Good Will 1.5
Solution
Particulars Amount ($) Millons a) Purchase consideration paid 6.3 b) Net Assets
Aquired: Land 1.2 Buildings 2.9 Inventory 1.7 Liabilities -1 4.8 (a) - (b)
Good Will 1.5.
while determining the pH the pH of the water is n.pdfarasanlethers
while determining the pH the pH of the water is not considered actually when salts
are added to water it dissciated to form H+ ions leading to increase in H+ ion concentration and
decrease in pH
Solution
while determining the pH the pH of the water is not considered actually when salts
are added to water it dissciated to form H+ ions leading to increase in H+ ion concentration and
decrease in pH.
Quantum Numbers and Atomic Orbitals By solving t.pdfarasanlethers
Quantum Numbers and Atomic Orbitals By solving the Schrödinger equation (Hy
= Ey), we obtain a set of mathematical equations, called wave functions (y), which describe the
probability of finding electrons at certain energy levels within an atom. A wave function for an
electron in an atom is called an atomic orbital; this atomic orbital describes a region of space in
which there is a high probability of finding the electron. Energy changes within an atom are the
result of an electron changing from a wave pattern with one energy to a wave pattern with a
different energy (usually accompanied by the absorption or emission of a photon of light). Each
electron in an atom is described by four different quantum numbers. The first three (n, l, ml)
specify the particular orbital of interest, and the fourth (ms) specifies how many electrons can
occupy that orbital. Principal Quantum Number (n): n = 1, 2, 3, …, 8 Specifies the energy of
an electron and the size of the orbital (the distance from the nucleus of the peak in a radial
probability distribution plot). All orbitals that have the same value of n are said to be in the same
shell (level). For a hydrogen atom with n=1, the electron is in its ground state; if the electron is in
the n=2 orbital, it is in an excited state. The total number of orbitals for a given n value is n2.
Angular Momentum (Secondary, Azimunthal) Quantum Number (l): l = 0, ..., n-1. Specifies the
shape of an orbital with a particular principal quantum number. The secondary quantum number
divides the shells into smaller groups of orbitals called subshells (sublevels). Usually, a letter
code is used to identify l to avoid confusion with n: l 0 1 2 3 4 5 ... Letter s p d f g h ... The
subshell with n=2 and l=1 is the 2p subshell; if n=3 and l=0, it is the 3s subshell, and so on. The
value of l also has a slight effect on the energy of the subshell; the energy of the subshell
increases with l (s < p < d < f). Magnetic Quantum Number (ml): ml = -l, ..., 0, ..., +l. Specifies
the orientation in space of an orbital of a given energy (n) and shape (l). This number divides the
subshell into individual orbitals which hold the electrons; there are 2l+1 orbitals in each subshell.
Thus the s subshell has only one orbital, the p subshell has three orbitals, and so on. Spin
Quantum Number (ms): ms = +½ or -½. Specifies the orientation of the spin axis of an electron.
An electron can spin in only one of two directions (sometimes called up and down). The Pauli
exclusion principle (Wolfgang Pauli, Nobel Prize 1945) states that no two electrons in the same
atom can have identical values for all four of their quantum numbers. What this means is that no
more than two electrons can occupy the same orbital, and that two electrons in the same orbital
must have opposite spins. Because an electron spins, it creates a magnetic field, which can be
oriented in one of two directions. For two electrons in the same orbital, the spins must be
opposite to each oth.
They are molecules that are mirror images of each.pdfarasanlethers
They are molecules that are mirror images of each other. They have the same basic
structure, but are rearranged in such a way that it is impossible to turn one into the other by
simple rotation.
Solution
They are molecules that are mirror images of each other. They have the same basic
structure, but are rearranged in such a way that it is impossible to turn one into the other by
simple rotation..
Well u put so many type of compounds here.Generally speakingi) t.pdfarasanlethers
Well u put so many type of compounds here.
Generally speaking
i) the materials or compounds or biological compounds which contains acidic protons [ the
protons which can be replaceable by the addition of base]
ii) compounds containing double bonds i.e. unsaturation
iii) compounds containing polar functional groups like aldehyde , ketones , esters etc
do react dramatically with the addition of acids or bases.
eg. materials :- inorganic acid / bases
biological system :- porphyrene system [contains replaceable hydrogen atoms]
Solution
Well u put so many type of compounds here.
Generally speaking
i) the materials or compounds or biological compounds which contains acidic protons [ the
protons which can be replaceable by the addition of base]
ii) compounds containing double bonds i.e. unsaturation
iii) compounds containing polar functional groups like aldehyde , ketones , esters etc
do react dramatically with the addition of acids or bases.
eg. materials :- inorganic acid / bases
biological system :- porphyrene system [contains replaceable hydrogen atoms].
Ventilation is the process of air going in and out of lungs. Increas.pdfarasanlethers
Ventilation is the process of air going in and out of lungs. Increased ventilation elevates the
oxygen level in arterial blood. It also alters the pH of blood, calcium level affecting the nerves,
muscles etc.
Solution
Ventilation is the process of air going in and out of lungs. Increased ventilation elevates the
oxygen level in arterial blood. It also alters the pH of blood, calcium level affecting the nerves,
muscles etc..
A1) A living being or an individual is known as an organism and it i.pdfarasanlethers
A1) A living being or an individual is known as an organism and it is a member of a species. A
species is a group of organisms that contains a set of specialized characteristics which distinguish
them from other organisms. The number of variety of species occurring in a community is
known as the species diversity. Species diversity has two important components-species richness
and species evenness. The species richness is the number of different species present in a
community. For example, a biological community like a coral reef contains large number of
species existing within the community and exhibits the high species richness. In contrast a forest
community containing limited number of specific plants exhibits low species richness. More
number of species present in an ecosystem represent its health because of the absence of factors
like nutrient depletion, competition, predation and extinction of species.
A2) New species arrive in habitat by geographical isolation and by immigration. The island
closer to the main land becomes a big source of immigration and have higher immigration rate
and contains higher species richness. The island distant from the main land has low immigration
rates because the species have to travel a lot to reach the island. Thus, these two factors influence
the species richness on the islands.
A3) A species chooses a specific habitat depending on availability of resources like nutrients and
other biotic factors. A diverse ecosystem with great variety of producer species producing more
plant biomass supports a great variety of a consumer species. The greater species richness in an
ecosystem makes it more productive, stable and sustainable. The greater species richness
promotes the food web and biotic interactions within the ecosystems resulting in greater
sustainability and enables to withstand the environmental disturbances like drought.
A4)
Native species are those that live in a specific ecosystem. Other species that migrate or
accidentally introduced in to another ecosystem are called as non native species or invasive or
exotic species.
The species that indicate or intimate the early warning of the damage to a community or an
ecosystem are known as indicator species. Birds are very good biological indicators as they can
predict the environmental changes rapidly.
The habitat loss by species is due to human activitites which introduce a species into a new
geographic location. For example, wild African honey bees known as killer bees were imported
to Brazil and caused damaged to native honey bees. Human activities like heavy utilization of
chemical pesticides is declining the populations of bird species. Butter flies are also good
indicator species as they are associated with several plant species making them vulnerable to
habitat loss and fragmentation due to heavy chemical fertilizers and pesticide usage. These
activities make the species to find new habitat to colonize and survive.
Solution
A1) A living being or .
there are laws and regulations that would pertain to an online breac.pdfarasanlethers
there are laws and regulations that would pertain to an online breach of 10,000 patient records
with identifiable data such as ssn and payment history ie HIPAA (health insurance portability
and accountability act ) is a fedral law that provides baseline privacy and security standards for
medical information and the us department health and human services is the fedral agency
incharge of creating rules that implement HIPAA and also enforcing HIPAA and this security
rule ie it protects only electronic medical records and it also applies to covered entities and there
are three types of covered entities ie health care providers get paid to provide health care doctors
, dentists , nursing homes ,hospitals, urgent medical care etc and the health care in order to
provide health care in exchange for payment . health plans play the cost of medical care like
health insurance companies .health care clearing houses process information so that it can be
transmitted in standard format between covered entities for eg they take the important
information from doctor and put it in standard code format that can be used for insurance
purposes . a bussiness associate acts as subcontractors as they creates , receives , maintains or
transmits the protected health information on behalf of covered entity and the responsibility of
bussiness associates that they make sure that they should protect patient health records according
to HIPAA standards.HIPAA privacy rules applies to protect health information which includes
all individual identifiable health information which includes patient health records about past
present and future and there mental health records and treatment provided to persons and their
payments and they also includes names , date of birth and addresses and phone no and social
securit numbers and they also protect the conversations between patient and doctors have the
same privacy . there are some violation rules if any wrong happens then individual can file case
against them according to HIPAA rules .
therefore the security of the data will continue to grow importance as health care industries move
towards greater implementation of electronic health records . personal electronic health records
devices , independent consent management tools and privacy preserving datamining and
statistical disclosure limitations and pesudonymization in this phase they replace the patient
names by providing with patient ids that can be linked to their original identities and it protects
individual identities .whereas in independent consent management tools relies on health trust as
they store health related data if researchers want to search health data they should first contact
health trusts where as personl electronic devices requires personal computer to manage their
health information . these are the rules and laws to protect patients records and data and their
payments .
Solution
there are laws and regulations that would pertain to an online breach of 10,000 pat.
The false statement among the given list is “Territoriality means ho.pdfarasanlethers
The false statement among the given list is “Territoriality means holding space, while
preemption means defending space.”
The actual meaning of territoriality means, defending space in which exclusion of aggressive
behaviour occurs, and preemption means holding space.
Solution
The false statement among the given list is “Territoriality means holding space, while
preemption means defending space.”
The actual meaning of territoriality means, defending space in which exclusion of aggressive
behaviour occurs, and preemption means holding space..
The current article is discussing about the role of SOX4 geneprotei.pdfarasanlethers
The current article is discussing about the role of SOX4 gene/protein in the metastasis, and
tumourogenesis.
Introduction:-
SOX 4 is the transcription factor produces Sox4 protein in humans,which regulates the
embryonic development and it directly invovles in the apoptosis regulation leading to the
tumourogenesis. The malfunction of the gene results in the decreement of parathyroid hormone
production so that bone desoption occurs.
In the current study explain importance of the SOX 4 gene, the interdigital tissue is lysed by the
apoptosis by the expression of SOX4 protein, so in the carcinoma cells, if we knock down of this
gene causes the decreeased cell proliferation and induced apoptosis by activating caspases 3 and
7.
It causes various carcinoma like example : Intra hepatitic metastatisis tissue, prostate cancer,lung
cancer, colorectal cancer, breast cancer, myeloma,pineoblastoma, bladder cancer , gastric cancer.
these all types are due high expression of SOX 4 gene(upregulation or over production).
Solution
The current article is discussing about the role of SOX4 gene/protein in the metastasis, and
tumourogenesis.
Introduction:-
SOX 4 is the transcription factor produces Sox4 protein in humans,which regulates the
embryonic development and it directly invovles in the apoptosis regulation leading to the
tumourogenesis. The malfunction of the gene results in the decreement of parathyroid hormone
production so that bone desoption occurs.
In the current study explain importance of the SOX 4 gene, the interdigital tissue is lysed by the
apoptosis by the expression of SOX4 protein, so in the carcinoma cells, if we knock down of this
gene causes the decreeased cell proliferation and induced apoptosis by activating caspases 3 and
7.
It causes various carcinoma like example : Intra hepatitic metastatisis tissue, prostate cancer,lung
cancer, colorectal cancer, breast cancer, myeloma,pineoblastoma, bladder cancer , gastric cancer.
these all types are due high expression of SOX 4 gene(upregulation or over production)..
The major similarities between rocks and minerals are as follows1.pdfarasanlethers
The major similarities between rocks and minerals are as follows:
1. Both of them are geological substances which exists on earth.
2. Both are solid, inorganic and naturally-occuring substances.
However, these are different in following ways:
1. Rocks are classified by geological processes whereas minerals are classified by chemical
processes.
2. Rocks do not play any role in biological processes whereas minerals play definitive role.
3. Sometivmes, fosil remains are found embeded inside rocks while minerals don\'t have fossils.
Solution
The major similarities between rocks and minerals are as follows:
1. Both of them are geological substances which exists on earth.
2. Both are solid, inorganic and naturally-occuring substances.
However, these are different in following ways:
1. Rocks are classified by geological processes whereas minerals are classified by chemical
processes.
2. Rocks do not play any role in biological processes whereas minerals play definitive role.
3. Sometivmes, fosil remains are found embeded inside rocks while minerals don\'t have fossils..
Pipelining understandingPipelining is running multiple stages of .pdfarasanlethers
Pipelining understanding:
Pipelining is running multiple stages of the same process in parallel in a way that efficiently uses
all the available hardware while respecting the dependencies of each stage upon the previous
stages. In the laundry example, the stages are washing, drying, and folding. By starting a wash
stage as soon as the previous wash stage is moved to the dryer, the idle time of the washer is
minimized. Notice that the wash stage takes less time than the dry stage, so the wash stage must
remain idle until the dry stage finishes: the steady state throughput of the pipeline is limited by
the slowest stage in the pipeline. This can be mitigated by breaking up the bottleneck stage into
smaller sub-stages. For those less concerned with laundry-based examples, consider a video
game. The CPU computes the keyboard/mouse input each frame and moves the camera
accordingly, then the GPU takes that information and actually renders the scene; meanwhile, the
CPU has already begun calculating what\'s going to happen in the next frame.
How Pipelining will done:
In class, we mentioned that interpreting each computer instruction is a four step process: fetching
the instruction, decoding it and reading the register, executing it, and recording the results. Each
instruction may take 4 cycles to complete, but if our throughput is one instruction each cycle,
then we would like to perform, on average, $n$ instructions every $n$ cycles. To accomplish
this, we can split up an instruction\'s work into the 4 different steps so that other pieces of
hardware work to decode, execute, and record results while the CPU performs the fetch. The
latency to process each instruction is fixed at 4 cycles, so by processing a new instruction every
cycle, after four cycles, one instruction has been completed and three are \"in progress\" (they\'re
in the pipeline). After many cycles the steady state throughput approaches one completed
instruction every cycle.
An assembly line in a auto manufacturing plant is another good example of a pipelined process.
There are many steps in the assembly of the car, each of which is assigned a stage in the pipeline.
Typically the depth of these pipelines is very large: cars are pretty complex, so there need to be a
lot of stages in the assembly line. The more stages, the longer it takes to crank the system up to a
steady state. The larger the depth, the more costly it is to turn the system around: A branch
misprediction in an instruction pipeline would be like getting one of the steps wrong in the
assembly line: all the cars affected would have to go back to the beginning of the assembly line
and be processed again.
OnLive Example[Realtime]:
OnLive is a company that allows gamers to play video games in the cloud. The games are run on
one of the company\'s server farms, and video of the game is sent back to your computer. The
idea is that even the lamest of computers can run the most highly intensive games because all the
computer does .
main.cpp
#include
#include
#include \"SwimmingPool.h\"
using namespace std;
void printMainMenu();
void printPoolVolume();
void printGetPoolDimensions(bool);
void printHasDimensions();
void checkDimensions();
void printError();
void printPoolDimensions();
double editValue(double);
void printGetFillRate();
void printGetDrainRate();
void printAddWater();
void printDrainRate();
void printFillRate();
char printWantwer();
SwimmingPool pool;
int _response;
int _numResponses;
double _length;
double _width;
double _depth;
//double _currentwerVolume;
double _drainRate;
double _fillRate;
bool _end;
char _newValue[5];
int main()
{
int fillTime;
int drainTime;
double drained;
// Set output style and precision
cout << fixed << showpoint << setprecision(2);
// Main program loop
// ends when _end==true
while (!_end)
{
// Prints main option list
printMainMenu();
// Switch based on response
switch (_response)
{
// Sets pool dimensions
case 1:
if (pool.hasDimensions())
printHasDimensions();
else
{
printPoolDimensions();
printPoolVolume();
}
break;
// Prints pool dimensions
case 2:
printGetPoolDimensions(false);
system(\"pause\");
break;
// Prints fill rate
case 3:
printGetFillRate();
break;
// Prints drain rate
case 4:
printGetDrainRate();
break;
// Determine water need to fill pool to capacity
case 5:
checkDimensions();
if (!pool.hasWater())
cout << \"\ The pool is currently empty\";
else
{
cout << \" The pool currently has \"
<< pool.getwerVolume()
<< \" units\"
<< endl;
}
cout << \"\ \ Water needed: \"
<< pool.getFillAmount(pool.getwerVolume())
<< \" units of water\ \ \";
system(\"pause\");
break;
// Determine time required to fill pool at rate
case 6:
if (!pool.hasDimensions())
{
cout << \" Pool dimensions not yet entered.\ \";
printGetPoolDimensions(false);
}
if (pool.getFillRate() <= 0)
printGetFillRate();
cout << \"\ Time to fill pool: \"
<< pool.getFillTime()
<< endl
<< endl;
system(\"pause\");
break;
// Determine time required to drain pool at rate
case 7:
checkDimensions();
if (_drainRate <= 0)
printGetDrainRate();
if (!pool.hasWater())
{
char response = printWantwer();
while (response != \'y\' && response != \'n\')
{
printError();
response = printWantwer();
}
if (response == \'y\')
printAddWater();
else
break;;
}
cout << \"\ Time to drain pool: \"
<< pool.getDrainTime()
<< endl
<< endl;
system(\"pause\");
break;
case 8:
checkDimensions();
if (pool.getFillRate() <= 0)
printGetFillRate();
else
printFillRate();
cout << \"\ Enter fill time: \";
cin >> fillTime;
pool.setFillTime(fillTime);
pool.setwerVolume(pool.getwerVolume() + pool.fill());
cout << endl
<< pool.fill()
<< \" units of water were added to the pool\ \ \"
<< \" The pool now contains \"
<< pool.getwerVolume()
<< \" units of water\ \ \";
system(\"pause\");
break;
case 9:
checkDimensions();
if (pool.getDrainRate() <= 0)
printGetDrainRate();
else
printDrainRate();
cout << \"\ Enter drain time: \";
cin >> drainTime;
pool.setDrainTime(drainTime);
if (!pool.hasWater())
{
char response = printWantwe.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Here is how the code works1. Patient.java is an Abstract Class whi.pdf
1. Here is how the code works
1. Patient.java is an Abstract Class which contains the required attributes and a constructor for
initializing the Patient object
2. PatientImpl.java is a class which extends the Abstract class Patient.java and contains a
constructor which makes a call to the superclass and initializes the superclass with passed
arguments
3. PatientComparator.java is a class which implements the comparator interface and specfies the
criteria for comparing two Patient objects
4. Main.java drives the complete program by providing a menu to the user with the three options
that is for adding a patient, finding the next highest priority patient to be served and exiting the
program
Please find the code as follows:-
Patient.java Code:-
package com.chegg.patient;
import java.util.Date;
abstract class Patient {
private String name;
private Date dob;
private Date admission;
private String complaint;
private int priority;
public Patient(String name, Date dob, Date admission, String complaint, int priority) {
this.name = name;
this.dob = dob;
this.admission = admission;
this.complaint = complaint;
this.priority = priority;
}
public String toString() {
return this.name + this.dob + this.admission + this.complaint + this.priority;
}
public String getName() {
return name;
}
public void setName(String name) {
2. this.name = name;
}
public Date getDob() {
return dob;
}
public void setDob(Date dob) {
this.dob = dob;
}
public Date getAdmission() {
return admission;
}
public void setAdmission(Date admission) {
this.admission = admission;
}
public String getComplaint() {
return complaint;
}
public void setComplaint(String complaint) {
this.complaint = complaint;
}
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
}
}
PatientImpl.java Code
package com.chegg.patient;
import java.util.Date;
public class PatientImpl extends Patient {
public PatientImpl(String name, Date dob, Date admission, String complaint, int priority) {
super(name, dob, admission, complaint, priority);
}
}
PatientComparator.java Code
3. package com.chegg.patient;
import java.util.Comparator;
public class PatientComparator implements Comparator {
@Override
public int compare(Patient arg0, Patient arg1) {
if(arg0.getPriority() == arg1.getPriority()){
if(arg0.getAdmission().compareTo(arg1.getAdmission())==-1){
return -1;
}
else
return 1;
}
if(arg0.getPriority() comparator = new PatientComparator();
PriorityQueue Pq = new PriorityQueue(10, comparator);
while (true) {
System.out.println("1. Enter New Patient Data");
System.out.println("2. Retrieve Next Patient to treat");
System.out.println("3. Exit");
choice = sc.nextInt();
sc.nextLine();
switch (choice) {
case 1: {
System.out.println("Enter Name");
name = sc.nextLine();
System.out.println("Enter Date of birth in format yyyy-mm-dd");
String dob_String = sc.next();
dob = parseDate(dob_String);
admission = new Date();
System.out.println("Enter Complaint");
sc.nextLine();
complaint = sc.nextLine();
System.out.println("Enter Priority");
priority = sc.nextInt();
Patient myPatient = new PatientImpl(name, dob, admission, complaint, priority);
Pq.add(myPatient);
System.out.println(myPatient.toString());
4. break;
}
case 2: {
if (Pq.size() > 0) {
Patient nextPatient = Pq.remove();
System.out.println(nextPatient.toString());
}else
System.out.println("No Patients Pending");
break;
}
case 3: {
if(Pq.size()>0){
System.out.println("Patients are pending in the queue");
continue;
}else{
sc.close();
System.exit(0);
}
}
}
}
}
public static Date parseDate(String date) {
try {
return new SimpleDateFormat("yyyy-MM-dd").parse(date);
} catch (ParseException e) {
return null;
}
}
}
Solution
Here is how the code works
1. Patient.java is an Abstract Class which contains the required attributes and a constructor for
initializing the Patient object
5. 2. PatientImpl.java is a class which extends the Abstract class Patient.java and contains a
constructor which makes a call to the superclass and initializes the superclass with passed
arguments
3. PatientComparator.java is a class which implements the comparator interface and specfies the
criteria for comparing two Patient objects
4. Main.java drives the complete program by providing a menu to the user with the three options
that is for adding a patient, finding the next highest priority patient to be served and exiting the
program
Please find the code as follows:-
Patient.java Code:-
package com.chegg.patient;
import java.util.Date;
abstract class Patient {
private String name;
private Date dob;
private Date admission;
private String complaint;
private int priority;
public Patient(String name, Date dob, Date admission, String complaint, int priority) {
this.name = name;
this.dob = dob;
this.admission = admission;
this.complaint = complaint;
this.priority = priority;
}
public String toString() {
return this.name + this.dob + this.admission + this.complaint + this.priority;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getDob() {
return dob;
6. }
public void setDob(Date dob) {
this.dob = dob;
}
public Date getAdmission() {
return admission;
}
public void setAdmission(Date admission) {
this.admission = admission;
}
public String getComplaint() {
return complaint;
}
public void setComplaint(String complaint) {
this.complaint = complaint;
}
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
}
}
PatientImpl.java Code
package com.chegg.patient;
import java.util.Date;
public class PatientImpl extends Patient {
public PatientImpl(String name, Date dob, Date admission, String complaint, int priority) {
super(name, dob, admission, complaint, priority);
}
}
PatientComparator.java Code
package com.chegg.patient;
import java.util.Comparator;
public class PatientComparator implements Comparator {
@Override
7. public int compare(Patient arg0, Patient arg1) {
if(arg0.getPriority() == arg1.getPriority()){
if(arg0.getAdmission().compareTo(arg1.getAdmission())==-1){
return -1;
}
else
return 1;
}
if(arg0.getPriority() comparator = new PatientComparator();
PriorityQueue Pq = new PriorityQueue(10, comparator);
while (true) {
System.out.println("1. Enter New Patient Data");
System.out.println("2. Retrieve Next Patient to treat");
System.out.println("3. Exit");
choice = sc.nextInt();
sc.nextLine();
switch (choice) {
case 1: {
System.out.println("Enter Name");
name = sc.nextLine();
System.out.println("Enter Date of birth in format yyyy-mm-dd");
String dob_String = sc.next();
dob = parseDate(dob_String);
admission = new Date();
System.out.println("Enter Complaint");
sc.nextLine();
complaint = sc.nextLine();
System.out.println("Enter Priority");
priority = sc.nextInt();
Patient myPatient = new PatientImpl(name, dob, admission, complaint, priority);
Pq.add(myPatient);
System.out.println(myPatient.toString());
break;
}
case 2: {
if (Pq.size() > 0) {
8. Patient nextPatient = Pq.remove();
System.out.println(nextPatient.toString());
}else
System.out.println("No Patients Pending");
break;
}
case 3: {
if(Pq.size()>0){
System.out.println("Patients are pending in the queue");
continue;
}else{
sc.close();
System.exit(0);
}
}
}
}
}
public static Date parseDate(String date) {
try {
return new SimpleDateFormat("yyyy-MM-dd").parse(date);
} catch (ParseException e) {
return null;
}
}
}