Questions
Write an algorithm in pseudo code to find one element and delete it in a doubly...

Write an algorithm in pseudo code to find one element and delete it in a doubly linked list. Your algorithm will print the original list, request the user to put in an element to be deleted, then print the final list after the deletion is done. If the element doesn’t exist in the list, print "XXX is not in the list" where "XXX" should be the one you received from the user.

Use the following as your test cases to evaluate whether your algorithm works correctly:

if you have a linked list: 3<->2<->0,

with user input 5, your algorithm should print "5 is not in the list".

with user input 2, your algorithm should print  "3<->0".

if your linked list is empty, with user input 5, your algorithm should print "5 is not in the list".

In: Computer Science

II. Big Numbers 1. Implement this program in a file named bigNums.py. 2. Create a numerical...

II. Big Numbers 1. Implement this program in a file named bigNums.py. 2. Create a numerical (integer) list, named numbers. Populate the list with 1,000,000 (one million) integer values with values from 0 to 999,999. Hint: Use the range() function. 3. Print the length of the list to the screen. Ensure you have 1,000,000 items in your list. Hint: Use the len() function. 4. Print the smallest item value in the list to the screen. Hint: use the min() function. Example: print('List min value is: ' + str(min(numbers))) 5. Print the largest item value in the list to the screen. Hint: use the max() function. Example: print('List max value is: ' + str(max(numbers))) 6. Print the sum of all the item values to the screen. Hint: use the sum() function. Example: print('List sum is: ' + str(sum(numbers))) 7. Create a slice of the list starting at item index 100. 8. Make the slice 25 items in length. 9. Copy the slice to be a new list named new_numbers. 10. Print the new list to the screen.

In: Computer Science

Part 1 Here is some code: def foo(var): var = [] var.append("hello") var.append("world") list = ["bah"]...

Part 1

Here is some code:

def foo(var):
    var = []
    var.append("hello")
    var.append("world")

list = ["bah"]
foo(list)
print(list)

Which Option is correct?

A) ["hello","world"] is output because python passes the list by reference and the list is changed inside the function.

B) ["bah"] is output because python passes the list by value so changes to the list in the function are made to a separate list than the one that is passed in.

C) ["bah"] is output because python passes the list by reference but a new reference is created by the first line in the function so subsequent changes are made to a separate list than the one that is passed in.

Part 2

Consider this code:

list1 = []
list2 = list1

list2.append(1)
list2.append(2)
list1.append(3)

Which option is correct?

A) list1 contains [3] and list2 contains[1,2]

B) list1 contains [3] and list2 references the same list as list1

C) list1 contains [1,2,3] and list2 references the same list as list1

D) list2 contains [1,2,3] and list1 also contains [1,2,3] but the 3 is stored in a different location than list2


In: Computer Science

I need C++ programming with output. I have tried other programming and it does not work....

I need C++ programming with output. I have tried other programming and it does not work. So please give me the one that actually works.

Assignment 1

Design your own linked list class that works as a template class. It should provide member functions for appending, inserting and deleting nodes. The destructor should destroy the list. The class should also provide a member function that will display the contents of the list to the screen. The class should also provide a member function to search the list for an element in the list. The search should return the index (location) of the item in the list. So if it is the first element in the list then it should return 0. If the item is not in the list, it should return -1. Have main create two instances of the linked list with different data types and show that all of the functions work correctly.

Assignment 2

In this program you will use the linked list created in Assignment 1. First you will create a class that holds information about the weather for a given month which should be called WeatherStats. It should have data members that are doubles to hold the amount of rain for the month and the amount of snow for the month. It will also have a data member that holds the number of sunny days during the month. It should provide accessors and mutators for the private data members. Main will create an instance of the linked list with a data type of the WeatherStats (LinkedList). The program should ask the user for how many months they wish to enter weather statistics for. The program will then prompt the user for that information (rain, snow and sunny days). The data needs to be stored in the WeatherStats class and it should be appended to the linked list. Main must then call a function that displays the data in the list; this function will call the display function in the linked list. Main will call a function that determines the month with the largest and smallest amount of rain, snow and sunny days. This function should not be part of the linked list. It should appear in the same file as main. A function will need to be added to the linked list that provides an item from the list. The function in the linked list will return the object stored in the list. The function in main will need to request each item in the list one at a time. Another solution is to create a derived class of the linked list, which does all of the work for finding the largest and smallest.

In: Computer Science

Question: The purpose for this project is to reinforce the knowledge from Chapter Two of the...

Question: The purpose for this project is to reinforce the knowledge from Chapter Two of the textbook. The ...

The purpose for this project is to reinforce the knowledge from Chapter Two of the textbook. The students will practice how to implement stack and queue data structure using list structure, for instance, ArrayList. The students will also apply stack and queue in real project, for instance, to check if a string is a palindrom.

Tasks:

     1. Use ArrayList to implement MyStack class which define the data  

       structure that has Last In First Out property (35%)

     2. Use ArrayList to implement MyQueue class which define the data

       structure that has First In First Out property (35%)

     3. Write a function public static Boolean isPalindrome(String sentence)

       (30%). This function returns true if sentence is a palindrome; false   

       otherwise.

******************************************************************************************************

import java.util.Scanner;

public class CSCI463ProjectTwo
{
    public static void main(String [] args)
    {
        Scanner input = new Scanner(System.in);
        String sentence;
        String again;
        do{
            System.out.println("Enter a sentence, I will tell you if it is a palindrome: ");
            sentence = input.nextLine();
            if(isPalindrome(sentence))
                System.out.println("\"" + sentence + "\" is a palindrome!");
            else
                System.out.println("\"" + sentence + "\" is not a palindrome!");
            System.out.println("Do you want another test (\"YES\" or \"NO\"): ");
            again = input.nextLine();
        }while(again.equalsIgnoreCase("YES"));
        
    }
    
    /**
     * isPalindrom returns true if the given String is a palindrom
     * @
     */
    public static boolean isPalindrome(String sentence)
    {
        // declare a MyStack s
        // declare a MyQueue q
        for(int i = 0; i < sentence.length(); i++)
        {
            // if ith character in sentence is a letter
                // convert to upper case and push it into s and q
        }
        while(!s.isEmpty()){
            // if the front of the queue not match the top of stack
                // return false
            // pop out top of the stack and front of the queue
        }
        return true;
    }  
}

***********************************************************************************************************************

import java.util.ArrayList;

public class MyStack<E>
{
    private ArrayList<E> list; // used to store elements in stack
    private int top; // the index of top element
    
    /**
     * constructor construct an empty stack
     */
    public MyStack()
    {
        
    }
    
    /**
     * push push a given element on the top of the stack
     */
    public void push(E item)
    {
        
    }
    
    /**
     * isEmpty return true if the stack is empty; false otherwise
     * @return true if the stack is empty; false otherwise
     */
    public boolean isEmpty()
    {
        
    }
    
    /**
     * peek Return the top element
     */
    public E peek()
    {
       
    }
    
    /**
     * pop Remove the top element from the stack. If the stack is empty,nothing happen
     */
    public void pop()
    {
       
    }
    
    /**
     * size return the size of the stack
     * @return number of elements in stack
     */
    public int size()
    {

    }
}

****************************************************************************************

import java.util.ArrayList;

public class MyQueue<E>
{
    private ArrayList<E> list; // hold the elements in queue
    private int tail; // index of the last element in queue
    
    /**
     * constructor construct an empty queue
     */
    public MyQueue()
    {
    }
    
    /**
     * isEmpty return true if the queue is empty; false otherwise
     * @return true if the queue is empty; false otherwise
     */
    public boolean isEmpty()
    {
       
    }
    
    /**
     * size return the size of the queue
     * @return the number of elements in queue
     */
    public int size()
    {
        
    }
    
    /**
     * peek return the front element of the queue
     * @return the front element of the queue. If the queue is empty, return null
     */
    public E peek()
    {
        
    }
    
    /**
     * pop remove the front element of the queue
     */
    public void pop()
    {
       
    }
    
    /**
     * push push a new element to the queue
     */
    public void push(E item)
    {
        
    }
}

In: Computer Science

The patient is admitted to the hospital with a diagnosis of right calf DVT. Below are...

The patient is admitted to the hospital with a diagnosis of right calf DVT. Below are the orders:

  • Bed rest with bathroom privileges
  • CBC, UA, PT, PTT stat
  • Guiac stool daily X 3 days
  • Heparin 5,000 units bolus IV X 1
  • Heparin 25,000 units in 250ml D5W to infuse at 1000 units/hour
    • ****Have students do the math to determine: What do you set the pump at:
      • mL/hr = 250 ml X 1000 units = 10mL
        • 25,000 units hr hr
  • Adjust heparin infusion per protocol
  • Daily PT/INR
  • Warfarin 10mg by mouth X1 tonight
  • Call for daily warfarin dose
  1. Why was bed rest with BRP ordered for the patient?
  1. Why was a bolus of heparin given before starting a continuous heparin infusion?

7. Why was warfarin started simultaneously with the heparin?

PART II:

8. When can the heparin infusion be discontinued?

9. Name the drug that antagonizes the effect of heparin:

10. Name the drug that is an antidote to warfarin:

11. List at least 4 bleeding prevention precautions the nurse would discuss with the patient:

12. What discharge instructions will the patient need regarding:

  1. Diet:
  2. Medications:
  3. Out-patient lab tests:

13. What is the major risk of DVT?

14. If the patient were not a candidate for anticoagulation therapy, what surgical intervention could be done to minimize this risk?

15. What chronic complication is the patient at risk for as a result of having a DVT?

16. List interventions for the patient to prevent or minimize this complication. (Select all that apply)

   Avoid sitting for long periods

BP Control

Apply Compression stockings in the evening

Regular Exercise

Weight reduction

Encourage dependent leg positioning

In: Nursing

Discharge Plan Assignment Case: Cindy, 13, with poor nutritional intake, Bulimia Nervosa. Recently lost his father...

Discharge Plan Assignment Case:

Cindy, 13, with poor nutritional intake, Bulimia Nervosa. Recently lost his father to alcoholism. lives with her mother in a private home. Has insurance coverage through mother. Resides in New York, Brooklyn, Zip code 11205

A client scheduled for discharge back to their community New York, Brooklyn, Zip code 11205 from the acute care setting. As the Community Health Nurse assigned to be the Case Manager for this client, you will be required to prepare a discharge plan of care for the client (template provided). Plan of care must focus on Primary, Secondary and Tertiary levels of prevention for management of the client while in the community, resources and knowledge of the resources available within the community. Students provided with a discharge plan template.

Points allotted as follows:

  • Identification of 3 Priority Nursing Diagnoses for care in the community – 12%
  • Identification of Primary, Secondary and Tertiary levels of prevention appropriate for age, gender and diagnosis – 6%
  • Setting S.M.A.R.T objectives for continuity of care in the community setting – 2.0%
  • identify the health care agencies within the community (11205) that you would most likely collaborate with to ensure that your client receives optimal care in the community setting – 5.0%

Priority Nursing Diagnoses

Primary Prevention needs

Secondary Prevention needs

Tertiary Prevention needs

S.M.A.R.T Objectives for each Diagnosis

Based on the diagnoses, list the resources needed to care for this client in their Community (11205)

Nursing Diagnosis 1

Nursing Diagnosis 2

Nursing Diagnosis 3

As the Community Health Nurse for this client, use the Functional Health Status Approach method for Community Assessment list the agencies available in the zip-code area to facilitate partnering for care of the individual in their community:

In: Nursing

PLEASE NUMBER EACH ANSWER Students will use advanced looping methods including replicate(), lapply(), sapply(), and apply(),...

PLEASE NUMBER EACH ANSWER

Students will use advanced looping methods including replicate(), lapply(), sapply(), and apply(), and access datasets provided with R packages in an R script.

  1. The function call, rnorm(1), generates a normal random number. Use replicate() to generate 10 normal random numbers and assign them to a vector called nums.
  2. The R statement, data(iris), loads the built-in R data set iris. This dataset has 150 rows and 5 columns. The 5 column names are "Sepal.Length","Sepal.Width","Petal.Length","Petal.Width" and "Species".
    1. Write R code(s) to return a list of 4 items that correspond to the averages of the first 4 columns in iris. The contents of the list should be as follows:

      $Sepal.Length
      [1] 5.843333

      $Sepal.Width
      [1] 3.057333

      $Petal.Length
      [1] 3.758

      $Petal.Width
      [1] 1.199333
  3. With the iris dataset still loaded,
    1. write R code(s) to return a vector of 4 items that correspond to the averages of the first 4 columns in iris. The contents of the vector should be as follows:

Sepal.Length

Sepal.Width

Petal.Length

Petal.Width

5.843333

3.057333

3.7580000

1.199333

  1. The following R code converts the contents of the first 4 columns in iris to a matrix called data.
    data=as.matrix(iris[,1:4])
    1. Write R code(s) to use apply() to return a vector that contains the max values of the 4 columns. The contents of the vector should be as follows [Hint, use max()]:

Sepal.Length

Sepal.Width

Petal.Length

Petal.Width

7.9

4.4

6.9

2.5

  1. Write R code(s) to read the contents of the provided file COS-206-ShoppingCart.html into a variable called cart and then show the first 5 lines of cart.

In: Statistics and Probability

A. According to Equation 20.7, an ac voltage V is given as a function of time t by V = Vo sin 2ft, where Vo is the peak voltage and f is the frequency (in hertz).

 

A. According to Equation 20.7, an ac voltage V is given as a function of time t by V = Vo sin 2ft, where Vo is the peak voltage and f is the frequency (in hertz). For a frequency of 56.0 Hz, what is the smallest value of the time at which the voltage equals one-half of the peak-value?

B. The rms current in a copy machine is 7.36 A, and the resistance of the machine is 19.8Ω. What are (a) the average power and (b) the peak power delivered to the machine?

C. A portable electric heater uses 21.8 A of current. The manufacturer recommends that an extension cord attached to the heater receive no more than 2.64 W of power per meter of length. What is the smallest radius of copper (resistivity 1.72 x 10-8 Ω·m) wire that can be used in the extension cord? (Note: An extension cord contains two wires.)   of about 12A

D. The average power used by a stereo speaker is 65 W. Assuming that the speaker can be treated as a 4.3-Ω resistance, find the peak value of the ac voltage applied to the speaker.

 

In: Physics

Of 380 randomly selected medical students, 21 said that they planned to work in a rural...

Of 380 randomly selected medical students, 21 said that they planned to work in a rural community. Find a 95% confidence interval for the true proportion of all medical students who plan to work in a rural community. Use the given degree of confidence and sample data to construct a confidence interval for the population proportion p. Please show how to do.

In: Math