Chapter 20, programming challenge 2: Linked List Sorting and Reversing
Modify the LinkedList1 class presented in this chapter by adding sort() and reverse() methods. The reverse method reverses the order of the elements in the list, and the sort method rearranges the elements in the list so they are sorted in alphabetical order. Do not use recursion to implement either of these operations. Extend the graphical interface in the LinkedListDemo class to support sort and reverse commands, and use it to test the new methods.
This must be done in java (netbeans)
In: Computer Science
A sample of 36 students Irving College produce a mean gpa of 3.2. The standard deviation of all students is .6. Find the 95% confidence interval.
STEP 1: Find the standard deviation of the sample: .6 divided by square root of 36 = .1
STEP 2: Find the Z-score associated with 95% confidence (Go to table IV in the front of your book and find the Z-score that has .975 to the left of it. (We look for .975, because the table gives the area to the left of the Z-score [see the image at the top of the table], and if a Z-score has .975 to the left of it, it has .025 in the right tail. A confidence interval has "two tails", so the total in the tails is .025 + .025 = .05. The "inside" would be 1 - .05 = .95. The z-score is 1.96
HINT:
You can use the following numbers as guidelines for Z-scores:
|
Confidence Interval |
Z-Score |
|
99% |
2.57 |
|
98% |
2.33 |
|
95% |
1.96 |
|
90% |
1.65 |
STEP 3: Multiply the z-score and the standard deviation of the sample together: 1.96 * .1 = .196
STEP 4: Construct your confidence interval by subtracting this number from the mean (3.2-.196 = 3.04) and adding this number to the mean (3.2 +.196 = 3.396). The 95% confidence interval is 3.04 to 3.396.
In: Statistics and Probability
By mid 1900s black footed ferrets had declined to virutal extinction because their primary prey (prairie dogs > 95% of the diet of these ferrets) has disappeared (due to disease and hunting). Starting >30 years ago, the ferrets were reintroduced to a series of sites int he nrothern US where prairie dog populations were restored to natural levels. Betty Biologist is assigned the task of understanding population dynamics at several of the reintroduction sites. Below is a summary of the sites of reintroduction she is monitoring -- they include two "new ferret reintroduction sites" just about 10 years old (where prairie dogs are now hyperabundant ) and two "old ferret reintroduction sites" where prairie dog populations are at much lower densities (approximating historical abundances).
Betty conducts a snapshot census in one of her sites. She finds the following information: there are 500 new females in the cohort, 200 1 year old individuals, 150 2 year old individuals, 100 3 year old individuals, 50 4 year old individuals and no individuals older than 4. What survival profile do ferrets in this site have? She also learns that ferrets can't reproduce in their first year of life, but otherwise at this site have constant birth rates (consistent with the average rates she found in literature, described above).
A. Calculate gross and net reproductive rates and explain the difference in words
B. If the total population in plot B is now 1000 ferrets, how many ferrets would you expect in the old site in 10 years? Why?
In: Statistics and Probability
You are working as an administrative assistant in a busy GP practice in a suburb where the community consists of people newly arrived in Australia and a younger cohort of individuals who have moved to the area and are heroin addicts. The GP clinic is the only clinic in the area that provides a bulk billing service and needle exchange program.
Mrs. Rizzo is an elderly lady of 78 years, from Italy. Mrs. Rizzo was brought to Australia by her son and daughter in law after her husband died. Mrs. Rizzo does not speak any English but relies on her son to interpret for her. Mrs. Rizzo has been in Australia for over 10 years but has made no effort to learn English and except for when her son accompanies her rarely leaves the house.
On arrival at the surgery it was apparent that Mrs. Rizzo was in pain. There was a lot of yelling, gesturing, pulling of hair and crying. Another patient attending the clinic tells her to shut up™ and asks if you could put the old bag outside™. Her son became very upset and soon both the son and the other client were yelling at each other. Mrs. Rizzo continued to wail.
You need to deal with this situation but privately
you felt that Mrs. Rizzo was making a lot of fuss.
1.7) What verbal and nonverbal
communication could you use in this situation?
1.8) Reflection on own social and
cultural perspectives and biases for the situation in the
scenario.
1.9) Identify a strategy that you
can do to improve own self and social awareness.
1.10) Explain how your response
contributes to the development of work place and professional
relationships based on appreciation of diversity and inclusiveness
to make the workplace safe for all.
In: Nursing
You are working as an administrative assistant in a busy GP practice in a suburb where the community consists of people newly arrived in Australia and a younger cohort of individuals who have moved to the area and are heroin addicts. The GP clinic is the only clinic in the area that provides a bulk billing service and needle exchange program.
Mrs. Rizzo is an elderly lady of 78 years, from Italy. Mrs. Rizzo was brought to Australia by her son and daughter in law after her husband died. Mrs. Rizzo does not speak any English but relies on her son to interpret for her. Mrs. Rizzo has been in Australia for over 10 years but has made no effort to learn English and except for when her son accompanies her rarely leaves the house.
On arrival at the surgery it was apparent that Mrs. Rizzo was in pain. There was a lot of yelling, gesturing, pulling of hair and crying. Another patient attending the clinic tells her to shut up™ and asks if you could put the old bag outside™. Her son became very upset and soon both the son and the other client were yelling at each other. Mrs. Rizzo continued to wail.
You need to deal with this situation but privately you felt that Mrs. Rizzo was making a lot of fuss.
Questions
1.7) What verbal and nonverbal
communication could you use in this situation?
1.8) Reflection on own social and
cultural perspectives and biases for the situation in the
scenario.
1.9) Identify a strategy that you can do to improve own self and social awareness
1.10) Explain how your response
contributes to the development of work place and professional
relationships based on appreciation of diversity and inclusiveness
to make the workplace safe for all.
In: Nursing
In: Nursing
This activity delves into another aspect of the Old Testament. Some of the Old Testament is narrative reading, like that we have covered already. Some is Hebrew poetry, like the psalms we read for last week. However, a majority of the content of the Old Testament is prophetic writing which speaks a message from God to some audience, either believers or non-believers. Many of the prophets and characters interacted with God, and their lives were influenced by their faith and their relationship with God. The readings this week all reflect a message from God that is drawn from the character’s experience. Job’s experience teaches believers how to deal with significant personal loss; Hosea’s experience reflects God’s faithful love for the world in a manner similar to a faithful lover in an unfaithful situation; Daniel’s experience was as a believer captured and told to serve a foreign king that worshiped other gods, and how Daniel responded. Isaiah, on the other hand, received verbal messages from God that pointed to a far distant Savior, the Messiah who we recognize as Jesus.
Read Job 1-7, 38-42; Isaiah 1-11; 40-41; 52:13-53:12; Hosea 1, 3, 11-14; and Daniel 1-6. In the first paragraph, describe in detail the experiences, good and bad, of one of the four characters in the Bible reading. Try to ensure that all four characters are represented among members of the cohort. Describe the way in which experience shaped that character, and how God uses suffering and other experiences for His almighty purpose. What did each person learn from suffering or difficulty?
In: Psychology
Use python write a function that checks the result of the blackjack game, given the sum of all cards in player 1’s and player 2’s hand in each round. For the i-th round, the i-th index of player1 list represents the sum of all cards of player1, and the i-th index of player2 list represents player2's card sum. The i-th index of the returned list should be the winner's card sum. If both players' card sums go over 21 in a round, we put 0 for that round to indicate that no one wins instead. You can assume two input lists always have the same length.
Example:
If player1’s list is [19, 25, 23], player2’s list is [20, 15, 25], the returned list should be [20, 15, 0]. Since in the first round, 20 is greater than 19 but not exceeds 21; in the second round, 25 exceeds 21 but 15 doesn’t; and in the third round, both 23 and 25 exceed 21.
def check_Blackjack(player1, player2):
"""
>>> check_Blackjack([19, 21, 22], [21, 19, 3])
[21, 21, 3]
>>> check_Blackjack([17, 21, 22, 29], [15, 19, 3, 4])
[17, 21, 3, 4]
>>> check_Blackjack([], [])
[]
"""
In: Computer Science
The following Assignment Questions are related to Java Collection Interfaces (Queue, List, Map, Set, etc), and Java IOStream.
Write a function that counts the occurrence of a specific letter (Eg. “a”) in a file. Where the letter can be defined at the prompt line (command line). [3 Marks].
In: Computer Science
For example, I have an input text file that reads:
"Hello, how are you?"
"You look good today."
"Today is a great day."
How can I write a function that inputs each line into a node in a linked list? Thank you. (Note: the input text files could have a different amount of lines, and some lines could be blank.)
This is the linked list code:
#include <iostream>
#include <cstdlib>
#include <fstream>
class Node
{
public:
Node* next;
int data;
};
using namespace std;
class LinkedList
{
public:
int length;
Node* head;
LinkedList();
~LinkedList();
void add(int data);
void print();
};
LinkedList::LinkedList(){
this->length = 0;
this->head = NULL;
}
LinkedList::~LinkedList(){
std::cout << "LIST DELETED";
}
void LinkedList::add(int data){
Node* node = new Node();
node->data = data;
node->next = this->head;
this->head = node;
this->length++;
}
void LinkedList::print(){
Node* head = this->head;
int i = 1;
while(head){
std::cout << i << ": " << head->data << std::endl;
head = head->next;
i++;
}
}
int main(int argc, char const *argv[])
{
LinkedList* list = new LinkedList();
list->print();
delete list;
return 0;
}
In: Computer Science