Questions
Write a function in Python to compute the sample mean of a list of numbers. The...

  1. Write a function in Python to compute the sample mean of a list of numbers. The return value should be the sample mean and the input value should be the list of numbers. Do not use a built-in function for the mean. Show an example of your function in use.   

Thank You

In: Computer Science

Complete the required methods: public class SongList { // instance variables private Song m_last; private int...

Complete the required methods:

public class SongList
{
// instance variables
private Song m_last;
private int m_numElements;

// constructor
// Do not make any changes to this method!
public SongList()
{
m_last = null;
m_numElements = 0;
}

// check whether the list is empty
// Do not make any changes to this method!
boolean isEmpty()
{
if (m_last == null)
return true;
else
return false;
}

// return the size of the list (# of Song nodes)
// Do not make any changes to this method!
public int size()
{
return m_numElements;
}

// add a new Song to the circular linked list with the given artist and
// title, keeping the list sorted by *song title*.
public void add(String artist, String title)
{
// TODO: implement this method
}

// remove a Song associated with the given artist and title from the list,
// keeping the list sorted by *song title*.
public boolean remove(String artist, String title)
{
// TODO: implement this method
}
  
  
// build and return a circular linked list that contains all songs from the
// given artist
public SongList buildList(String artist)
{
// TODO: implement this method
}
  
// return a string representation of the list
// Do not make any changes to this method!
public String toString()
{   
String listContent = "";
Song current = m_last;
  
if (m_last != null)
do
{
current = current.getLink();
listContent += " [" + current.getArtist() + " - " + current.getTitle() + "]\n";

} while (current != m_last);

return listContent;
}
}

// The Song class that represents a song
// Do not make any changes to this file!

public class Song
{
// instance variables
private String m_artist;
private String m_title;
private Song m_link;

// constructor
public Song(String artist, String title)
{
m_artist = artist;
m_title = title;
m_link = null;
}

// getters and setters
public void setArtist(String artist)
{
m_artist = artist;
}

public String getArtist()
{
return m_artist;
}

public void setTitle(String title)
{
m_title = title;
}

public String getTitle()
{
return m_title;
}
  
public void setLink(Song link)
{
m_link = link;
}

public Song getLink()
{
return m_link;
}
}

In: Computer Science

case study 1.    Draw an Entity Relationship Diagram (ERD) for the following problem. Make sure you identify...

case study

1.    Draw an Entity Relationship Diagram (ERD) for the following problem. Make sure you identify correct relationships, attributes, and identifiers (keys).

2.    Implement the database design into tables using an industrial-strength database management system (e.g. Oracle SQL+).

case:

HELP is a voluntary organization that provides aid to people. Based on the following brief description of operations, create the appropriate fully labeled Crow’s Foot ERD.

Individuals volunteer their time to carry out the tasks of the organization. For each volunteer, their name, address, and telephone number are tracked. Each volunteer may be assigned to several tasks during the time that they are doing volunteer work, and some tasks require many volunteers. It is possible for a volunteer to be in the system without having been assigned a task yet. It is possible to have tasks that no one has been assigned. When a volunteer is assigned to a task, the system should track the start time and end time of that assignment.  

For each task, there is a task code, task description, task type, and a task status. For example, there may be a task with task code “101,” description of “answer the telephone,” a type of “recurring,” and a status of “ongoing.” There could be another task with a code of “102,” description of “prepare 5000 packages of basic medical supplies,” a type of “packing,” and a status of “open.”  

For all tasks of type “packing,” there is a packing list that specifies the contents of the packages. There are many different packing lists to produce different packages, such as basic medical packages, child care packages, food packages, etc. Each packing list has a packing list ID number, packing list name, and a packing list description, which describes the items that ideally go into making that type of package. Every packing task is associated with only one packing list. A packing list may not be associated with any tasks, or may be associated with many tasks. Tasks that are not packing tasks are not associated with any packing list.

In: Computer Science

// The Song class that represents a song // Do not make any changes to this...

// The Song class that represents a song
// Do not make any changes to this file!

public class Song
{
// instance variables
private String m_artist;
private String m_title;
private Song m_link;

// constructor
public Song(String artist, String title)
{
m_artist = artist;
m_title = title;
m_link = null;
}

// getters and setters
public void setArtist(String artist)
{
m_artist = artist;
}

public String getArtist()
{
return m_artist;
}

public void setTitle(String title)
{
m_title = title;
}

public String getTitle()
{
return m_title;
}
  
public void setLink(Song link)
{
m_link = link;
}

public Song getLink()
{
return m_link;
}
}

Complete the required methods:

public class SongList
{
// instance variables
private Song m_last;
private int m_numElements;

// constructor
// Do not make any changes to this method!
public SongList()
{
m_last = null;
m_numElements = 0;
}

// check whether the list is empty
// Do not make any changes to this method!
boolean isEmpty()
{
if (m_last == null)
return true;
else
return false;
}

// return the size of the list (# of Song nodes)
// Do not make any changes to this method!
public int size()
{
return m_numElements;
}

// add a new Song to the circular linked list with the given artist and
// title, keeping the list sorted by *song title*.
public void add(String artist, String title)
{
// TODO: implement this method
}

// remove a Song associated with the given artist and title from the list,
// keeping the list sorted by *song title*.
public boolean remove(String artist, String title)
{
// TODO: implement this method
}
  
  
// build and return a circular linked list that contains all songs from the
// given artist
public SongList buildList(String artist)
{
// TODO: implement this method
}
  
// return a string representation of the list
// Do not make any changes to this method!
public String toString()
{   
String listContent = "";
Song current = m_last;
  
if (m_last != null)
do
{
current = current.getLink();
listContent += " [" + current.getArtist() + " - " + current.getTitle() + "]\n";

} while (current != m_last);

return listContent;
}
}

In: Computer Science

Change the LinkList class to work with DNode, in particular, adapt the implementation of the void...

  • Change the LinkList class to work with DNode, in particular, adapt the implementation of the void LinkList.deleteLast() method.

LINKLIST CLASS BELOW

/**
* Builds a singly linked list of size 5 and prints it to the console.
*
* @author Jochen Lang
*/

class LinkList {
DNode llist;

LinkList( int sz ) {
   if ( sz <= 0 ) {
   llist = null;
   }
   else {
   // start with list of size 1
   llist = new DNode( "0", null, null );
   DNode current = llist; // temp node for loop
   // add further nodes
   for ( int i=1; i        // create node and attach it to the list
       DNode node2Add = new DNode( Integer.toString(i), null, null );
       current.setNext(node2Add); // add first node
       current=node2Add;
   }
   }
}
  
/**
* Print all the elements of the list assuming that they are Strings
*/
public void print() {
   /* Print the list */
   DNode current = llist; // point to the first node
   while (current != null) {
   System.out.print((String)current.getElement() + " ");  
   current = current.getNext(); // move to the next
   }
   System.out.println();  
}

public void deleteFirst() {
   if ( llist != null ) {
   llist = llist.getNext();
   }
}

public void deleteLast() {

}

// create and display a linked list
public static void main(String [] args){
   /* Create the list */
   LinkList llist = new LinkList( 5 );
   /* Print the list */
   llist.print();
   /* delete first and print */
   llist.deleteFirst();
   llist.print();
   /* delete last and print 5 times */
   for ( int i=0; i< 5; ++i ) {
   llist.deleteLast();
   llist.print();
   }
}
}

DNODE CLASS BELOW

public class DNode {
  private Object element;
  private Node next;
  private Node prev;
  Node() { this(null, null, null); }
    Node(Object e, Node n, Node p) {
    element = e;
    next = n;
    prev = p;
  }
  public void setElement(Object newElem) { element = newElem; }
  public void setPrev(Node newPrev) { prev = newPrev; }
  public void setNext(Node newNext) { next = newNext; }
  public Object getElement() { return element; }
  public Node getNext() { return next; }
  public Node getPrev() { return prev; }
}

In: Computer Science

Can anyone explain to me why I am getting an access violation when I try to...

Can anyone explain to me why I am getting an access violation when I try to add notes? It occurs when I try to set the "pLast" pointer to the previous node (for a doubly linked list). The code worked as singly linked list. When I added a "pLast" pointer and the needed code to make it a doubly linked list everything broke. 

#include <iostream>
#include <stdlib.h>

using namespace std;

//build class that has a private function to inc count. 
class LinkedListCount {
private:
    struct CountNode {
        int data;
        int countVar; //Make the variable "countVar" private to protect integrity. 
        CountNode* pNext = NULL;
        CountNode* pLast = NULL; //Needed for bubbling back through list. 

    };
    //Keep track of head
    CountNode* head;
    CountNode* current;
    CountNode* temp;



public:
    //Constructor Function (Set default values for head, current, and temp) 
    LinkedListCount() {
        head = NULL;
        current = NULL;
        temp = NULL;
    }
    void AddNode(int dataIn) { //Addnode Function
        //Create and populate list. 
        CountNode* newNode = new CountNode; 
        newNode->pNext = NULL; 
        newNode->pLast = NULL;
        newNode->data = dataIn;
        temp = head;
        newNode->countVar = 0;
        if (temp != NULL) { //We already have data entery.
            if (temp->pNext == NULL) {
                newNode = temp->pNext;
                newNode->pLast = head; //****THIS IS WHERE ACCESS VIOLATION OCCURES
            }
            //Set variables with the understanding that the head is the only data point. 
            else {
                current = temp->pNext; //Set it equal to head. 
            }
            while (current->pNext != NULL) {//This could be eliminated with keeping track of a tail. 
                current = current->pNext; //Attach this to the end of the list. 
            }
            current->pNext = newNode; //And newMode->pNext = to Null so next time I add data I'll get to the end of the list. 
            newNode->pLast = current;
        }
        else if (head == NULL) {
            head = newNode;
        }

    }
};

void addNodes(LinkedListCount &DataList) { //Populates list. 

    for (int i = 0; i < 20; i++) {
        DataList.AddNode(i);
    }
}



int main(void)
{       
addNodes(DataList);   
}

In: Computer Science

GPA Versus Seating Location. A professor wanted to know whether there was a difference in students’...

  1. GPA Versus Seating Location. A professor wanted to know whether there was a difference in students’ grade point averages (GPA) depending on whether they sit in the front half of the classroom versus the back half of the classroom. In a previous semester, a random sample of students was selected from the front of a classroom and another random sample was selected from the back of a classroom and each student’s current GPA was recorded. The data provided in StatCrunch represent the GPAs from each random sample. At the 0.01 significance level, can the professor conclude from these data that the mean GPA for front sitters is different from than back sitters?  
  2. Front GPA   Back GPA
  3. 4.1   4.06
    4   4
    4   3.92
    3.92   3.7
    3.9   3.6
    3.9   3.5
    3.89   3.5
    3.876   3.43
    3.8   3.4
    3.8   3.4
    3.71   3.4
    3.7   3.25
    3.7   3.2
    3.7   3.2
    3.6   3.2
    3.54   3.1
    3.5   3.05
    3.5   3
    3.5   3
    3.5   3
    3.44   3
    3.4   3
    3.4   3
    3.4   3
    3.39   2.95
    3.33   2.94
    3.3   2.9
    3.26   2.9
    3.26   2.9
    3.25   2.87
    3.24   2.84
    3.22   2.8
    3.21   2.8
    3.11   2.8
    3.1   2.7
    3   2.67
    3   2.58
    3   2.5
    3   2.5
    3   2.5
    3   2.5
    2.9   2.46
    2.8   2.4
    2.67   2.1
    2.62   2.06
    2.5   2.04
    2.44   2
    2.05   ""
    2 ""
    2 ""
    1.96   ""
    1.92   ""
  1. What is (are) the parameter(s) of interest? Choose one of the following symbols (m (the mean of one sample); mD(the mean difference from a paired (dependent) samples);m1 - m2 (the mean difference of two independent samples) and describe the parameter in context of this question in one sentence.
  1. Depending on your answer to part (i), construct one or two relative frequency histograms. Remember to properly title and label the graph(s). Copy and paste the graph(s) into your document.
  1. Describe the shape of the histogram(s) in one sentence.
  1. Depending on your answer to part (i), construct one or two boxplots and copy and paste these graphs into your document.
  1. Does the boxplot (or do the boxplots) show any outliers? Answer this question in one sentence and identify any outliers if they are present.
  1. Considering your answers to parts (iii) and (v), is inference appropriate in this case? Why or why not? Defend your answer using the graphs in two to three sentences.
  1. GMU Health Center Waiting Time. During the flu season, it is known that the waiting time at the GMU Health Center can be extreme. A statistics student wanted to test her claim that the wait time was greater than 100 minutes. She took a random sample of wait times during the flu season and recorded them in StatCrunch.
  2. Waiting Time
    104.97
    120.72
    130.76
    137.39
    96.65
    240.49
    95.46
    107.98
    103.07
    116.83
    87.44
    114.05
    109.56
    120.6
    126.41
    135.78
    97.66
    19.75
    216.87
    114.29
    113.92
  1. What is (are) the parameter(s) of interest? Choose one of the following symbols (m (the mean of one sample); mD(the mean difference of two paired (dependent) samples);m1 - m2 (the mean difference of two independent samples) and describe the parameter in context of this question in one sentence.
  1. Depending on your answer to part (i), construct one or two relative frequency histograms. Remember to properly title and label the graph(s). Copy and paste the graph(s) into your document.
  1. Describe the shape of the histogram(s) in one sentence.
  1. Depending on your answer to part (i), construct one or two boxplots and copy and paste these graphs into your document.
  1. Does the boxplot (or do the boxplots) show any outliers? Answer this question in one sentence and identify any outliers if they are present.
  1. Considering the answers provided in parts (iii) and (v), is inference appropriate in this case? Why or why not? Defend your answer using the graphs in two to three sentences.

In: Statistics and Probability

GPA Versus Seating Location. A professor wanted to know whether there was a difference in students’...

  1. GPA Versus Seating Location. A professor wanted to know whether there was a difference in students’ grade point averages (GPA) depending on whether they sit in the front half of the classroom versus the back half of the classroom. In a previous semester, a random sample of students was selected from the front of a classroom and another random sample was selected from the back of a classroom and each student’s current GPA was recorded. The data provided in StatCrunch represent the GPAs from each random sample. At the 0.01 significance level, can the professor conclude from these data that the mean GPA for front sitters is different from than back sitters?  
  2. Front GPA   Back GPA
  3. 4.1   4.06
    4   4
    4   3.92
    3.92   3.7
    3.9   3.6
    3.9   3.5
    3.89   3.5
    3.876   3.43
    3.8   3.4
    3.8   3.4
    3.71   3.4
    3.7   3.25
    3.7   3.2
    3.7   3.2
    3.6   3.2
    3.54   3.1
    3.5   3.05
    3.5   3
    3.5   3
    3.5   3
    3.44   3
    3.4   3
    3.4   3
    3.4   3
    3.39   2.95
    3.33   2.94
    3.3   2.9
    3.26   2.9
    3.26   2.9
    3.25   2.87
    3.24   2.84
    3.22   2.8
    3.21   2.8
    3.11   2.8
    3.1   2.7
    3   2.67
    3   2.58
    3   2.5
    3   2.5
    3   2.5
    3   2.5
    2.9   2.46
    2.8   2.4
    2.67   2.1
    2.62   2.06
    2.5   2.04
    2.44   2
    2.05   ""
    2 ""
    2 ""
    1.96   ""
    1.92   ""

  1. What is (are) the parameter(s) of interest? Choose one of the following symbols (m (the mean of one sample); mD(the mean difference from a paired (dependent) samples);m1 - m2 (the mean difference of two independent samples) and describe the parameter in context of this question in one sentence.

  1. Depending on your answer to part (i), construct one or two relative frequency histograms. Remember to properly title and label the graph(s). Copy and paste the graph(s) into your document.

  1. Describe the shape of the histogram(s) in one sentence.

  1. Depending on your answer to part (i), construct one or two boxplots and copy and paste these graphs into your document.

  1. Does the boxplot (or do the boxplots) show any outliers? Answer this question in one sentence and identify any outliers if they are present.

  1. Considering your answers to parts (iii) and (v), is inference appropriate in this case? Why or why not? Defend your answer using the graphs in two to three sentences.
  1. GMU Health Center Waiting Time. During the flu season, it is known that the waiting time at the GMU Health Center can be extreme. A statistics student wanted to test her claim that the wait time was greater than 100 minutes. She took a random sample of wait times during the flu season and recorded them in StatCrunch.
  2. Waiting Time
    104.97
    120.72
    130.76
    137.39
    96.65
    240.49
    95.46
    107.98
    103.07
    116.83
    87.44
    114.05
    109.56
    120.6
    126.41
    135.78
    97.66
    19.75
    216.87
    114.29
    113.92

  1. What is (are) the parameter(s) of interest? Choose one of the following symbols (m (the mean of one sample); mD(the mean difference of two paired (dependent) samples);m1 - m2 (the mean difference of two independent samples) and describe the parameter in context of this question in one sentence.

  1. Depending on your answer to part (i), construct one or two relative frequency histograms. Remember to properly title and label the graph(s). Copy and paste the graph(s) into your document.

  1. Describe the shape of the histogram(s) in one sentence.

  1. Depending on your answer to part (i), construct one or two boxplots and copy and paste these graphs into your document.

  1. Does the boxplot (or do the boxplots) show any outliers? Answer this question in one sentence and identify any outliers if they are present.

  1. Considering the answers provided in parts (iii) and (v), is inference appropriate in this case? Why or why not? Defend your answer using the graphs in two to three sentences.

In: Statistics and Probability

Why is self plagiarism a form of cheating? Why is plagiarism cheating? give reason why they...

Why is self plagiarism a form of cheating? Why is plagiarism cheating? give reason why they both are wrong

Should teachers allow students to use previous work from another class? why and why not

In: Nursing

Stress and burnout are very common in nursing practice. Nursing students are aware of the many demands nurses and prospective nurses face each day.

Stress and burnout are very common in nursing practice. Nursing students are aware of the many demands nurses and prospective nurses face each day. 3 Good Things is an intervention to promote resilience and individual happiness?

In: Nursing