PRG/420: Java Programming – 8 LABS

(LAB 1) Output numbers in reverse

Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicating the number of integers that follow. For coding simplicity, follow each output integer by a space, including the last one. Assume that the list will always contain fewer than 20 integers.

Ex: If the input is:

5 2 4 6 8 10

the output is:

10 8 6 4 2

To achieve the above, first read the integers into an array. Then output the array in reverse.

(LAB 2) Middle Item

 

Given a sorted list of integers, output the middle integer. Assume the number of integers is always odd.

Ex: If the input is:

2 3 4 8 11 -1 

(where a negative indicates the end), the output is:

4

The maximum number of inputs for any test case should not exceed 9. If exceeded, output “Too many inputs”.

Hint: First read the data into an array. Then, based on the array’s size, find the middle item.

(LAB 3) Output values below an amount

 

Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, which indicates a threshold. Output all integers less than or equal to that last threshold value. Assume that the list will always contain fewer than 20 integers.

Ex: If the input is:

5 50 60 140 200 75 100

the output is:

50 60 75

The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75.

For coding simplicity, follow every output value by a space, including the last one.

Such functionality is common on sites like Amazon, where a user can filter results.

(LAB 4) Adjust list by normalizing

 

When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers.

For this program, adjust the values by subtracting the smallest value from all the values. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain fewer than 20 integers.

Ex: If the input is:

5 30 50 10 70 65

the output is:

20 40 0 60 55

The 5 indicates that there are five values in the list, namely 30, 50, 10, 70, and 65. 10 is the smallest value in the list, so is subtracted from each value in the list.

For coding simplicity, follow every output value by a space, including the last one.

(LAB 5) Word Frequencies

 

Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. Assume that the list will always contain fewer than 20 words.

Ex: If the input is:

5 hey hi Mark hi mark

the output is:

hey 1
hi 2
Mark 1
hi 2
mark 1

Hint: Use two arrays, one array for the strings and one array for the frequencies.

(LAB 6) Contains the character

 

Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. Assume at least one word in the list will contain the given character. Assume that the list of words will always contain fewer than 20 words.

Ex: If the input is:

4 hello zoo sleep drizzle z

then the output is:

zoo
drizzle

To achieve the above, first read the list into an array. Keep in mind that the character ‘a’ is not equal to the character ‘A’.

(LAB 7) Elements in a range

 

Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain fewer than 20 integers.

That list is followed by two more integers representing lower and upper bounds of a range. Your program should output all integers from the list that are within that range (inclusive of the bounds). For coding simplicity, follow each output integer by a space, even the last one. The output ends with a newline.

Ex: If the input is:

5 25 51 0 200 33
0 50

then the output is:

25 0 33 

(the bounds are 0-50, so 51 and 200 are out of range and thus not output).

To achieve the above, first read the list of integers into an array.

(LAB 8) Two smallest numbers

 

Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input begins with an integer indicating the number of integers that follow. You can assume that the list will have at least 2 integers and fewer than 20 integers.

Ex: If the input is:

5 10 5 3 21 2

the output is:

2 3

To achieve the above, first read the integers into an array.

Hint: Make sure to initialize the second smallest and smallest integers properly.

Four Types Of Perceptual Distortions

projection. Define each of these types of perceptual distortions and provide a full example of each perceptual distortion.

For each discussion, you are required to write an initial post (300 words) and one secondary post (200 words).  The discussion forums will be worth 40 points apiece—25 points for the initial post and 15 points for the secondary post.  For your initial and secondary posts, you must have two academic peer-reviewed articles for references.  You must get them from the library.  There are directions at the top of our Moodle page showing how to utilize the library

Reply to below response

 

Types of perceptual distortions:

Perception is the way toward incorporating their condition. In layman’s words, it is a half-production procedure to understand their environment to react legitimately. The current condition of the perceptual beneficiary depends on the brain, character and appreciation, where there is dependably a blunder in the depiction and ensuing data.

Stereotyping:

Stereotyping is specific gathering or class (social, ethnic, religious, or sexual introductions) just based on enrollment of the property, for example, he is an Italian, so he knows a ton about Rome. The most widely recognized, the adjustment in the obstruction

Halo effect:

Halo effect is between the two, a steady paying little respect to the general population is a component of the innovation depends on the numerous highlights Bust constructive effect on the great quality, have an antagonistic effect of terrible element in the purposes behind the other party less experienced individual, a notable attributes of the solid good ramifications For example, he is chuckling, so he should come clean.

Selective Perception:

Selective perception is the alternative Awareness Support and trust in the data that affirms the conviction that the pre-channel that depicts the particular data.

Projection:

Projection that they have the properties themselves or hand over to others emotions. For example, I have a few things that I experience the ill effects of it will put off, to defer our gathering can state an example he say

Estimate The Survival (Time To Progression To Hypertension)

A clinical trial is conducted to evaluate the efficacy of a new drug for prevention of

hypertension in patients with pre-hypertension (defined as systolic blood pressure between

120–139 mmHg or diastolic blood pressure between 80–89 mmHg). A total of 20 patients are

randomized to receive the new drug or a currently available drug for treatment of high blood

pressure. Participants are followed for up to 12 months, and time to progression to

hypertension is measured. The experiences of participants in each arm of the trial are shown

below.

data is on the document. the first one

 

To answer the question as to whether or not there is a difference in time to progression, a

Chi square statistic is computed. The critical value for rejection of the null hypothesis is

3.84. The computed Chi square is 0.335.

Based on comparing the computed Chi square and the critical Chi square, which of the

following is (are) true?

A. There is not statistically significant evidence to show that the time to progression is

different between groups.

B. There is statistically significant evidence to show that the time to progression is

different between groups.

C. The time to progression is essentially the same for each group.

D. a and c.

The hazard ratio risk of progression to hypertension is 0.658. Based on this computation,

which of the following is (are) true?

A. The risk of progression to hypertension is reduced by 34.2% in patients assigned

to the new drug as compared to the currently available drug.

B. The risk of progression to hypertension is 1.52 times higher in patient’s current

drug as compared to the new drug.

C. The risk of progression to hypertension is 5.12 times higher in patient’s current

drug as compared to the new drug

D. a and b

2. A clinical trial is conducted to evaluate the efficacy of a new drug for prevention of hypertension in patients with pre-hypertension (defined as systolic blood pressure between 120–139 mmHg or diastolic blood pressure between 80–89 mmHg). A total of 20 patients are randomized to receive the new drug or a currently available drug for treatment of high blood pressure. Participants are followed for up to 12 months, and time to progression to hypertension is measured. The experiences of participants in each arm of the trial are shown below.

 

New Drug   Currently Available Drug
Hypertension Free of Hypertension   Hypertension Free of Hypertension
7 8   6 8
8 8   7 9
10 8   9 11
  9   10 11
  11   11 12
  12      
  12      

 

 

Estimate the survival (time to progression to hypertension) functions for each treatment group using the Kaplan-Meier approach New Drug

Complete the table below.

 

Time, Months Number at Risk

Nt

Number of Events (Hypertension)

Dt

Number Censored

Ct

Survival Probability

St+1 = St*((Nt-Dt)/Nt)

0 10 0    
7   1    
8   1    
9   0    
10   1    
11   0    
12   0    

 

 

Currently Available Drug

Complete the table below.

 

Time, Weeks Number at Risk

Nt

Number of Events (Hypertension)

Dt

Number Censored

Ct

Survival Probability

St+1 = St*((Nt-Dt)/Nt)

0 10      
6        
7        
8        
9        
10        
11        
12        

 

 

 

To answer the question as to whether or not there is a difference in time to progression, a Chi square statistic is computed. The critical value for rejection of the null hypothesis is 3.84. The computed Chi square is 0.335.

 

Based on comparing the computed Chi square and the critical Chi square, which of the following is (are) true?

 

A. There is not statistically significant evidence to show that the time to progression is different between groups.

B. There is statistically significant evidence to show that the time to progression is different between groups.

C. The time to progression is essentially the same for each group.

D. a and c.

 

The hazard ratio risk of progression to hypertension is 0.658. Based on this computation, which of the following is (are) true?

 

A. The risk of progression to hypertension is reduced by 34.2% in patients assigned to the new drug as compared to the currently available drug.

B. The risk of progression to hypertension is 1.52 times higher in patient’s current drug as compared to the new drug.

C. The risk of progression to hypertension is 5.12 times higher in patient’s current drug as compared to the new drug

D. a and b

 

 

The mean BMI in patients free of diabetes was reported as 28.2.  The investigator conducting the study  hypothesizes that the BMI in patients free of diabetes is higher.  Based on the data given below is there evidence that the BMI is significantly higher that 28.2?  Use a 5% level of significance.     25 27 31 33 26 28 38 41 24 32 35 40Critical t value:                  (2 points)Computed t =          (2 points)Based on comparing the critical t value to the computed t value which of the following is (are) true?

a. There is statistically significant evidence at alpha=0.05 to show the BMI is significantly higher than 28.2.  b. There is not  statistically significant evidence at alpha=0.05 to show the BMI is significantly     higher that 28.2.  c. There are not enough data points to reach a conclusion.d. b and c.

 

A randomized controlled trial is run to evaluate the effectiveness of a new drug for asthma in children. A total of 250 children are randomized to either the new drug or placebo (125 per group).  The mean age of children assigned to the new drug is 12.4 with a standard deviation of 3.6 years.  The mean age of children assigned to the placebo is 13.0 with a standard deviation of 4.0 years.  Is there a statistically significant difference in ages of children assigned to the treatments?  Apply the two sample z test at a 5% level of significance.

1. Critical z value = +/-                          (2 points)

2. Computed statistic=                         (2 points)

3. Based on comparing the computed statistic to the critical value which of the following is (are) true? (6 points)

a. There is significant evidence, alpha=0.05, that there is a difference in ages of children assigned to the treatments.

b. There is not significant evidence, alpha=0.05, that there is a difference in ages of children assigned to the treatments.

c. Statistically speaking the difference in initial weights and weights after 6 weeks is 0.

d. b and c.

 

A small pilot study is conducted to investigate the effect of a nutritional supplement on total body weight.  Six participants agree to take the nutritional supplement.  To assess its effect on body weight, weights are measured before starting the supplementation and then after 6 weeks.  The data are shown below.  Is there a significant increase in body weight following supplementation?  Use a paired t-test at a 5% level of significance.

1. df=_____ (2 points)

2. Critical value: ______  (2 points)

3. Computed statistic:_____ (2 points)

4. Based on comparing the computed statistic to the critical value which of the following is (are) true? (4 points)

a. There is significant evidence, alpha=0.05, to show that body weight increased following supplementation?

b. There is not significant evidence, alpha=0.05, to show that body weight increased following supplementation?

c. Statistically speaking the difference in initial weights and weights after 6 weeks is 0.

d. b and c.

 

A study is designed to investigate whether there is a difference in response to various treatments in patients with rheumatoid arthritis.  The outcome is patient’s self-reported effect of treatment.  The data are shown below.  Is there a statistically significant difference in the proportions of patients who show improvement between treatments 1 and 2.  Apply the test at a 5% level of significance.

1. Critical value:                           (2 points)

2. Computed statistic:                  (2 points)

3. Based on comparing the computed statistics to the critical value which of the following is (are) true? (6 points)

a. There is significant evidence, alpha=0.05, to show that there is a difference in the proportions of patients who show improvement between treatments 1 and 2.

b. There is not significant evidence, alpha=0.05, to show that there is a difference in the proportions of patients who show improvement between treatments 1 and 2.

c. There is significant evidence, alpha=0.05, to show that there is a no difference in the proportions of patients who show improvement between treatments 1 and 2.

d. a and c.

 

A randomized controlled trial is run to evaluate the effectiveness of a new drug for asthma in children. A total of 250 children are randomized to either the new drug or placebo (125 per group).  There are 63 boys assigned to the new drug group and 58 boys assigned to the placebo.  Is there a statistically significant difference in the proportions of boys assigned to the treatments?  Apply the appropriate test at a 5% level of significance.1. Critical value= +/-                             (2 points)2. Computed statistics=                       (2 points)3. Based on comparing the computed statistic to the critical value which of the following is (are) true?  (6 points)

a. There is significant evidence, alpha=0.05, that there is a difference in the proportions of boys assigned to the treatments.b. There is not significant evidence, alpha=0.05, that there is a difference in the proportions of boys assigned to the treatments.c. Statistically speaking the difference in the proportions of boys assigned to the treatments is 0.d. b and c.

 

 

The following data were collected in a clinical trial to compare a new drug to a placebo for its effectiveness in lowering total serum cholesterol.  Generate a 95% confidence interval for the difference in mean total cholesterol levels between treatments.

1. Upper limit of CI:                 (2 points)

2. Lower limit of CI:                 (2 points)

3. Based on the confidence interval which of the following is (are) true? (4 points)

a. There is significant evidence, alpha=0.05, to show that there is a difference in Total Serum Cholesterol between treatments New Drug and Placebo.

b. There is not significant evidence, alpha=0.05, to show that there is a difference in Total Serum Cholesterol between treatments New Drug and Placebo.

c. The difference between Total Serum Cholesterol between treatments New Drug and Placebo is essentially 0.

d. b and c.

 

Evolution Of Nurse Educators

Evolution of Nurse Educators

What were the skills required of nurse educators yesterday, what are they today, and what will they be tomorrow?

Though nursing has long been a forward-thinking profession, there is much value in looking to the past to better build for the future. Examining societal, political, and global trends allows nurse educators to develop programs that will meet the needs of their future learners. In addition, taking time to consider the volatility of the economic landscape, as well as the swift changes brought on by technology and medical informatics, nurse educators can better prepare themselves to teach students, staff, and patients.

In this Discussion, you creatively and critically explore the evolution of nursing education and thus the evolving role of the nurse educator.

 

To prepare:

·         Review Chapter 1, “History of Nursing Education in the United States” in the Keating course text. How has the nursing profession evolved in response to societal, economic, political, and technological factors? How has this evolution directly impacted the role of the nurse educator?

·         Review Chapter 20, “Issues and Challenges for Nurse Educators” also in the Keating text. Consider how the issues and challenges of today’s nurse educators differ from those of past nursing educators. Then, imagine the issues and challenges that might arise for tomorrow’s nurse educators in both clinical and academic settings.

·         Explore the website “Creative Writing Now” to review the parameters for writing a haiku. With this information in mind, write a haiku using the following questions as a guide:

o    If the first line of the haiku represented the roles of past nurse educators, what five-syllable description would you create?

o    If the second line represented the roles of today’s nurse educators, what seven-syllable description would you create?

o    If the third line represented the roles of tomorrow’s nurse educators, what five-syllable description would you create?

 

Questions to be addressed in my paper:

 

1.      An original haiku that portrays your perspective on the evolving role of nurse educators.

2.      Provide rationale for each line of your poem by citing examples related to the changing landscape of nursing education.

3.      Summary with Conclusion

 

 

REMINDERS:

1)      1-2 pages (addressing the 3 questions above excluding the title page and reference page).

2)      Kindly follow APA format for the citation and references! References should be between the period of 2011 and 2016. Please utilize the references at least three below as much as possible and the rest from yours.

3)     Make headings for each question.

 

 

References

 

Flood, M. E. (2011). Best-laid plans: A century of nursing curricula. In S. B. Keating (Ed.), Curriculum development and evaluation in nursing (2nd ed., pp. 5–32). New York, NY: Springer.

 

Chapter 1 gives an overview of the history of nursing education from the late 1800s to present day. Pivotal moments are discussed at length, as well as the evolution of accreditation requirements, baccalaureate education, associate degree programs, master’s programs, and doctoral programs.

Ruchala, P. L. (2011). Curriculum development and approval processes in changing educational environments. In S. B. Keating (Ed.), Curriculum development and evaluation in nursing (2nd ed., pp. 33–45). New York, NY: Springer.

 

Chapter 2 highlights the complex issues related to curriculum development and curriculum redesign. The impact of regulatory and accreditation agencies is also discussed.

Keating, S. B. (Ed.). (2015). Curriculum development and evaluation in nursing (3rd ed.). New York, NY: Springer.

  • Chapter 1, “History of Nursing Education in the United States”
  • Chapter 20, “Issues and Challenges for Nurse Educators” (pp. 437-463)

 

Similar to a textbook summary, Chapter 20 revisits each chapter of the text to pinpoint various issues and challenges nurse educators should be cognizant of. Sample curriculum designs are also presented.

 

Creative Writing Now. (2010). How to write a haiku poem: Haiku examples and tips. Retrieved from http://www.creative-writing-now.com/how-to-write-a-haiku.html

 

This website gives the definition for and examples of haiku poems. Use this page as a resource for creating your own haiku in this week’s Discussion.

 

Required Media

 

Laureate Education, Inc. (Executive Producer). (2012c). Requirements through the years. Baltimore, MD: Author. 

 

This week’s media illustrates the evolution of nursing education.

 

Optional Resources

 

Davida, M. (2012). History of nursing education: In our past, lies our future. Retrieved from http://nursingeducationhistory.org/