Questions
A recent drug survey showed an increase in the use of drugs and alcohol among local...

A recent drug survey showed an increase in the use of drugs and alcohol among local high school seniors as compared to the national percent. Suppose that a survey of 100 local seniors and 100 national seniors is conducted to see if the proportion of drug and alcohol use is higher locally than nationally. Locally, 67 seniors reported using drugs or alcohol within the past month, while 63 national seniors reported using them. Conduct a hypothesis test at the 5% level.

NOTE: If you are using a Student's t-distribution for the problem, including for paired data, you may assume that the underlying population is normally distributed. (In general, you must first prove that assumption, though.)

  • Part (d)

    State the distribution to use for the test. (Round your answers to four decimal places.)

    P'localP'national

    ~
    ,
  • Part (e)

    What is the test statistic? (If using the z distribution round your answer to two decimal places, and if using the t distribution round your answer to three decimal places.)
    ---Select---tz =

  • Part (f)

    What is the p-value? (Round your answer to four decimal places.)


    Explain what the p-value means for this problem.
  • If H0is false, then there is a chance equal to the p-value that the proportion of students who use drugs and alcohol locally is at least 0.04 more than the proportion of students who use drugs and alcohol nationally.
  • If H0is true, then there is a chance equal to the p-value that the proportion of students who use drugs and alcohol locally is 0.04 less than the proportion of students who use drugs and alcohol nationally.    
  • If H0is true, then there is a chance equal to the p-value that the proportion of students who use drugs and alcohol locally is at least 0.04 more than the proportion of students who use drugs and alcohol nationally.
  • If H0is false, then there is a chance equal to the p-value that the proportion of students who use drugs and alcohol locally is 0.04 less than the proportion of students who use drugs and alcohol nationally.
  • Part (g)

    Sketch a picture of this situation. Label and scale the horizontal axis and shade the region(s) corresponding to the p-value.

  • Part (h)

    Indicate the correct decision ("reject" or "do not reject" the null hypothesis), the reason for it, and write an appropriate conclusion.(i) Alpha (Enter an exact number as an integer, fraction, or decimal.)
    α = .05

    (ii) Decision:

    reject the null hypothesis

  • do not reject the null hypothesis    


    (iii) Reason for decision:

    Since p-value > α, we do not reject the null hypothesis.

  • Since p-value > α, we reject the null hypothesis.   

  • Since p-value < α, we reject the null hypothesis.

  • Since p-value < α, we do not reject the null hypothesis.


    (iv) Conclusion:

    There is sufficient evidence to show that the proportion of local seniors using drugs and alcohol locally is higher than the proportion of seniors using drugs and alcohol nationally.

  • There is not sufficient evidence to show that the proportion of local seniors using drugs and alcohol locally is higher than the proportion of seniors using drugs and alcohol nationally.    

  • Part (i)

    Explain how you determined which distribution to use.

    The standard normal distribution will be used because the samples involve the difference in proportions.

  • The t-distribution will be used because the samples are independent and the population standard deviation is not known.

  •     The t-distribution will be used because the samples are dependent.

  • The standard normal distribution will be used because the samples are independent and the population standard deviation is known.

In: Statistics and Probability

***IN JAVA*** Write a program contained a class Student which has firstName, lastName, mark, grade. The...

***IN JAVA***

Write a program contained a class Student which has firstName, lastName, mark, grade. The program should allow creation an array of object instances to assign firstName, lastName and mark from input user and perform and assign grade based on mark’s criteria displayed below.

MARKS

INTERVAL

95 - 100

90 - <95

85 - <90

80 - <85

75 - <80

70 - <75

65 - <70

60 - <65

0 - <60

LETTER GRADE

A+

A

B+

B

C+

C

D+

D

F

SAMPLE OF OUTPUT:

Enter section #: 1

How many students: 3

Enter student details:

First Name: John

Last Name: Kendall

Marks      : 96

Enter student details:

First Name: Mary

Last Name: Kendall

Marks      : 76

Enter student details:

First Name: Lucy

Last Name: Kendall

Marks      : 76

Result for Section 1

-------------------------------------------------------------------

FirstName               Last Name         Grade

John                    Kendall           A+

Mary                    Kendall           C+

Lucy                    Kendall           C+

Total students: 3

Average marks: 82.2     Average Grade: B

Highest: 96, by John Kendall

Location: 0

Another batch? (Yes – 1, No - 0) :> 1

Enter section #: 2

How many students: 6

Enter student details:

1)

First Name: John

Last Name: Kendall

Marks      : 96

2)

First Name: Mary

Last Name: Kendall

Marks      : 76

3)

First Name: Lucy

Last Name: Kendall

Marks      : 76

4)

First Name: Martin

Last Name: Kendall

Marks      : 86

5)

First Name: Mary

Last Name: Kendall

Marks      : 76

6)

First Name: Lucy

Last Name: Kendall

Marks      : 98

Result for Section 2

-------------------------------------------------------------------

FirstName               Last Name         Grade

John                    Kendall           A+

Mary                    Kendall           C+

Lucy                    Kendall           C+

Martin                  Kendall           B+

Mary                    Kendall           C+

Lucy                    Kendall           A+

Total students: 6

Average marks : 80.7    Average Grade: B

Highest: 98, by Lucy Kendall

Location: 6

           

Another batch? (Yes – 1, No - 0) :> 0

     

PROBLEM SOLVING TIPS:

Num

Tips

Grade

a)

Use class Student to create another class Students that will be built in the class implementing a Comparator.

/1m

b)

Use for enhanced method to display the grade of student by each batches

/1m

c)

In the main program, create sections of studlist, receive section number and number of students for each section. Use loop control structure to display output as shown in above and to assign input utilizing the studList structure.

/3m

d)

For each section, program will control input firstname, lastname and marks received from user and add into StudList.

/2m

e)

Use appropriate control structure to control input and program execution.

/4m

f)

In main, use Arrays sort() method, to help find the maximum grade achieved by each class and display the name of the student.

/3m

g)

In main, find the average performance (average section, mark and grade) of every batch and include in the output display.

Formula :

Average_mark = total/number of students;

/2m

h)

Use solution for practical provided to extend the program to capable to process more than one sections of students to process.

/ 4m

TOTAL:

/20m

In: Computer Science

I'm Getting an "unindented error" Please fix the bolded codes. Because I don't know whats going...

I'm Getting an "unindented error" Please fix the bolded codes. Because I don't know whats going on. Thank You.

# This program exercises lists.

# The following files must be in the same folder:
# abstractcollection.py
# abstractlist.py
# arraylist.py
# arrays.py
# linkedlist.py
# node.py
# input.txt - the input text file.

# Input: input.txt
# This file must be in the same folder.
# To keep things simple:
# This file contains no punctuation.
# This file contains only lowercase characters.
# Output: output.txt
# This file will be created in the same folder.
# All articles are removed.
# Certain prepositions are removed.
# Duplicate consecutive words are reduced to a single occurrence.
# Note: The words "first" and "last" are not reduced.
# Certain misspelled words are flagged.
# Occurrences of "first" are moved to the front of a line.
# Occurrences of "last" are moved to the end of a line.

from arraylist import ArrayList
from linkedlist import LinkedList

# Data:

articles = ArrayList(["a", "the"])
prepositions = LinkedList(["after", "before", "from", "in", "off", "on", "under", "out", "over", "to"])
misspellings = ["foriegn", "excede", "judgement", "occurrance", "preceed", "rythm", "thier", ]

inputFile = open("input.txt", "r")
outputFile = open("output.txt", "w")

FIRST = "first"
FLAG = "FLAG:"
LAST = "last"

# Processing:

# Part 1:
# Removes all items from the words list that are found in the removals list.
# Input:
# words - an ArrayList of words, no uppercase, no punctuation
# wordsIter - a list iterator for the words list
# removals - the list of words to remove
def removeItems(words, wordsIter, removals):
wordsIter.first()
  
while(words.hasNext()):

word = words.next()

if word in removals:

wordsIter.remove()

# Part 2:
# Removes extra occurrances of consecutive duplicate words from the words list.
# Note: It does not reduce the words "first" and "last".
# Input:
# words - an ArrayList of words, no uppercase, no punctuation
# wordsIter - a list iterator for the words list
def reduceDuplicates(words, wordsIter):
previousWord=""
wordsIter.first()
while(words.hasNext()):
word=words.next()
if(word=="first" or word=="last"):
previousWord=word
continue
if(word==previousWord):
wordsIter.remove()
previousWord=word

# Part 3:
# Flags certain misspelled words in the words list by inserting "FLAG:" before them.
# Input:
# words - an ArrayList of words, no uppercase, no punctuation
# wordsIter - a list iterator for the words list
# misspellings - the list of misspelled words to flag
def flagMisspelled(words, wordsIter, misspellings):
wordsIter.first()
while(wordsIter.hasNext()):
word=words.next()
if word in misspellings:
wordsIter.insert(FLAG)
wordsIter.next()

# Part 4:
# Move all occurrences of "first" to the front of the words list.
# Input:
# words - an ArrayList of words, no uppercase, no punctuation
# wordsIter - a list iterator for the words list
def moveFirstLit(words, wordsIter):
countFirst = 0
wordsIter.first()
while (wordsIter.hasNext()):
word = wordsIter.next()
if (word == FIRST):
wordsIter.remove()
countFirst += 1
for count in range(countFirst):
wordsIter.first()
if (wordsIter.hasNext()):
wordsIter.next()
wordsIter.insert(FIRST)

# Part 5:
# Move all occurrences of "last" to the end of the words list.
# Input:
# words - an ArrayList of words, no uppercase, no punctuation
# wordsIter - a list iterator for the words list
def moveLastLit(words, wordsIter):
countLast = 0
wordsIter.last()
while (wordsIter.hasNext()):
word = wordsIter.next()
if (word == LAST):
wordsIter.remove()
countLast += 1
for count in range(countLast):
wordsIter.last()
if (wordsIter.hasNext()):
wordsIter.next()
wordsIter.insert(LAST)

def writeOutputLine(words):
outputLine = " ".join(words)
outputLine = outputLine + "\n"
print(outputLine, end="")
outputFile.write(outputLine)

# Main processing loop:
for line in inputFile:
words = ArrayList(line.split())
wordsIter = words.listIterator()

# Make no changes to blank lines:
if (len(words) == 0):
writeOutputLine(words)
continue

# Make no changes to comment lines:
if (words[0] == "#"):
writeOutputLine(words)
continue

# Remove articles:
removeItems(words, wordsIter, articles)
  
# Remove prepositions:
removeItems(words, wordsIter, prepositions)

# Reduce duplicate consecutive words to a single occurrence:
reduceDuplicates(words, wordsIter)

# Insert "FLAG:" before certain misspelled words:
flagMisspelled(words, wordsIter, misspellings)
  
# Move all occurrences of "first" to the front of the line:
moveFirstLit(words, wordsIter)
  
# Move all occurrences of "last" to the end of the line:
moveLastLit(words, wordsIter)

# Write output line:
writeOutputLine(words)

# Wrap-up
inputFile.close()
outputFile.close()

In: Computer Science

• Asthma 1. Presentation & Diagnosis • o What are the subjective findings (symptoms that the...

• Asthma

1. Presentation & Diagnosis • o What are the subjective findings (symptoms that the patient reports, ex: SOB) associated with the condition? List a minimum of 3. o What are the objective findings (exam findings that you can measure, ex: tachypnea) associated with the condition? List a minimum of 3. o How is the diagnosis determined or confirmed? o What factors do you need to consider in selecting the best medication for the patient with the condition?

2. Treatment • o List 3 medication treatment options for the condition in the OUTPATIENT setting (cite with appropriate guidelines or scholarly, peer-reviewed journals). o List the mechanism of action for each drug. o List 3 potential adverse responses associated with each drug. o List 3 medication teaching points for each drug prescribed.

3. Scholarly Support & Interactive Dialogue • o Discussion post is supported with appropriate sources*^ o Source is published within the last 5 years o Reference list is provided and in-text citations match o Student provides a substantive** response to at least one topic-related post of a peer o Student responds to all direct faculty questions OR if student was not asked a direct question student responds to either a 2nd peer post or a faculty question directed towards another student

In: Nursing

I have the function call showGroceries(list); I need to create a new prototype above int main...

I have the function call showGroceries(list); I need to create a new prototype above int main that provides:

  • return type

  • function name

  • parameter(s) type(s)

Then copy-and-paste the prototype below int main. Give the parameter a name and then implement the function so that it takes the vector of strings and displays it so that a vector with the values:

{"milk", "bread", "corn"}

would display as:

Grocery list

1. milk

2. bread

3. corn

However, if there is nothing in the vector, instead it should display:

No need for groceries!

I have the following code

#include <iostream>
#include <vector>
using namespace std;

// function prototypes
char chooseMenu();
vector <string> addItem(vector <string>);


// main program
int main() {
vector <string> list;
char choice;
  
cout << "Welcome to Grocery List Manager\n";
cout << "===============================\n";
do{
choice = chooseMenu();
if( choice == 'a' || choice == 'A' ){
list = addItem(list);
}
}while( choice != 'q' && choice != 'Q' );
  
showGroceries(list);
  
return 0;
}

// function definitions

char chooseMenu()
{
char input;
// Menu input/output
cout << "Menu\n----\n";
cout << "(A)dd item\n";
cout << "(Q)uit\n";

cin >> input;
cin.ignore();
return input;
}

vector <string> addItem(vector <string>A)
{
string input;
// item input/output
cout << "Enter item:\n";
getline(cin,input);

A.push_back(input);
return A;
}

In: Computer Science

1)  Write a python program that opens a file, reads all of the lines into a list...

1)  Write a python program that opens a file, reads all of the lines into a list of strings, and closes the file. Use the Readlines() method. Test your programing using the names.txt file provided.
2) Convert the program into a function called loadFile, that receives the file name as a parameter and returns a list of strings.
3) Write a main routine that calls loadFIle three times to load the three data files given into three lists. Then choose a random element from the title list, two from the name list, and one from the descriptor list to generate a name. Print the name be in the form shown (you have to add the "the"):
title name name the descriptor
For example:
King Ludovicus Botolf the Bowman
Print the name to the screen.   
Submit your python file (.py) to Sakai

Part 2: Writing Files (Optional Extra Credit 20 pts)
Modify the program to generate 10 names and store them in a list.
Write a function, dumpFile that writes the list to a file called "CharacterNames.txt" There should be one Character Name on each line in the file.
Test the program to be sure it works

Im stumped at number 2

here is what i have for number 1



f = open('names.txt', 'r')
lines = f.readlines()
for line in range(len(lines)):
lines[line] = lines[line].rstrip()
print(lines)
f.close()

In: Computer Science

Write a program that reverses a text file by using a stack. The user interface must...

Write a program that reverses a text file by using a stack. The user interface must consist of 2 list boxes and 3 buttons. The 3 buttons are: Read - reads the text file into list box 1. Reverse - reverses the items in list box 1 by pushing them onto stack 1, then popping them from stack 1 (in the reverse order) and adding them to list box 2. Write - writes the contents of list box 2 to a new text file. At first, only the Read button is enabled. After it is clicked, it is disabled and the Reverse button is enabled. After it is clicked, it is disabled and the Write button is enabled. After it is clicked, it is disabled. The name of the input text file is "input.txt". The input text file will contain no more than 100 lines of text. This fact is not needed by the program. It simply means that memory usage is not an issue. The name of the output text file is "output.txt". Notes: 1. The name of your main class should be ReverseFileViaStack. 2. Use the Java class library Stack class for your stack. 3. Use a border layout for your contents pane. 4. In the north region include the following title: Reverse a Text File via a Stack. 5. Use a panel in the center region to contain the 2 list boxes (side-by-side). 6. Place the 3 buttons in the south region. 7. A useful resource for this project is the week 5 video: Java GUI List Components

In: Computer Science

Implement a priority queue using a DoublyLinkedList where the node with the highest priority (key) is...

Implement a priority queue using a DoublyLinkedList where the node with the highest priority (key) is the right-most node.
The remove (de-queue) operation returns the node with the highest priority (key).
If displayForward() displays List (first-->last) : 10 30 40 55
remove() would return the node with key 55.
Demonstrate by inserting keys at random, displayForward(), call remove then displayForward() again.
You will then attach a modified DoublyLinkedList.java (to contain the new priorityInsert(long key) and priorityRemove() methods), and a driver to demonstrate as shown above.

Use the provided PQDoublyLinkedTest.java to test your code.

public class PQDoublyLinkedTest
{
    public static void main(String[] args)
    {                             // make a new list
        DoublyLinkedList theList = new DoublyLinkedList();

        theList.priorityInsert(22);      // insert at front
        theList.priorityInsert(44);
        theList.priorityInsert(66);

        theList.priorityInsert(11);       // insert at rear
        theList.priorityInsert(33);
        theList.priorityInsert(55);
        
        theList.priorityInsert(10);
        theList.priorityInsert(70);
        theList.priorityInsert(30);

        theList.displayForward();     // display list forward
        Link2 removed = theList.priorityRemove();
        System.out.print("priorityRemove() returned node with key: ");
        removed.displayLink2();
        
    }  // end main()
}  // end class PQDoublyLinkedTest

_____________________________________________________________________________________________________________________________________________________

// doublyLinked.java
// demonstrates doubly-linked list
// to run this program: C>java DoublyLinkedApp

class Link
{
public long dData; // data item
public Link next; // next link in list
public Link previous; // previous link in list

public Link(long d) // constructor
{ dData = d; }

public void displayLink() // display this link
{ System.out.print(dData + " "); }

} // end class Link

class DoublyLinkedList
{
private Link first; // ref to first item
private Link last; // ref to last item

public DoublyLinkedList() // constructor
{
first = null; // no items on list yet
last = null;
}

public boolean isEmpty() // true if no links
{ return first==null; }

public void insertFirst(long dd) // insert at front of list
{
Link newLink = new Link(dd); // make new link

if( isEmpty() ) // if empty list,
last = newLink; // newLink <-- last
else
first.previous = newLink; // newLink <-- old first
newLink.next = first; // newLink --> old first
first = newLink; // first --> newLink
}

public void insertLast(long dd) // insert at end of list
{
Link newLink = new Link(dd); // make new link
if( isEmpty() ) // if empty list,
first = newLink; // first --> newLink
else
{
last.next = newLink; // old last --> newLink
newLink.previous = last; // old last <-- newLink
}
last = newLink; // newLink <-- last
}

public Link deleteFirst() // delete first link
{ // (assumes non-empty list)
Link temp = first;
if(first.next == null) // if only one item
last = null; // null <-- last
else
first.next.previous = null; // null <-- old next
first = first.next; // first --> old next
return temp;
}

public Link deleteLast() // delete last link
{ // (assumes non-empty list)
Link temp = last;
if(first.next == null) // if only one item
first = null; // first --> null
else
last.previous.next = null; // old previous --> null
last = last.previous; // old previous <-- last
return temp;
}

// insert dd just after key
public boolean insertAfter(long key, long dd)
{ // (assumes non-empty list)
Link current = first; // start at beginning
while(current.dData != key) // until match is found,
{
current = current.next; // move to next link
if(current == null)
return false; // didn't find it
}
Link newLink = new Link(dd); // make new link

if(current==last) // if last link,
{
newLink.next = null; // newLink --> null
last = newLink; // newLink <-- last
}
else // not last link,
{
newLink.next = current.next; // newLink --> old next
// newLink <-- old next
current.next.previous = newLink;
}
newLink.previous = current; // old current <-- newLink
current.next = newLink; // old current --> newLink
return true; // found it, did insertion
}

public Link deleteKey(long key) // delete item w/ given key
{ // (assumes non-empty list)
Link current = first; // start at beginning
while(current.dData != key) // until match is found,
{
current = current.next; // move to next link
if(current == null)
return null; // didn't find it
}
if(current==first) // found it; first item?
first = current.next; // first --> old next
else // not first
// old previous --> old next
current.previous.next = current.next;

if(current==last) // last item?
last = current.previous; // old previous <-- last
else // not last
// old previous <-- old next
current.next.previous = current.previous;
return current; // return value
}

public void displayForward()
{
System.out.print("List (first-->last): ");
Link current = first; // start at beginning
while(current != null) // until end of list,
{
current.displayLink(); // display data
current = current.next; // move to next link
}
System.out.println("");
}

public void displayBackward()
{
System.out.print("List (last-->first): ");
Link current = last; // start at end
while(current != null) // until start of list,
{
current.displayLink(); // display data
current = current.previous; // move to previous link
}
System.out.println("");
}

} // end class DoublyLinkedList

class DoublyLinkedApp
{
public static void main(String[] args)
{ // make a new list
DoublyLinkedList theList = new DoublyLinkedList();

theList.insertFirst(22); // insert at front
theList.insertFirst(44);
theList.insertFirst(66);

theList.insertLast(11); // insert at rear
theList.insertLast(33);
theList.insertLast(55);

theList.displayForward(); // display list forward
theList.displayBackward(); // display list backward

theList.deleteFirst(); // delete first item
theList.deleteLast(); // delete last item
theList.deleteKey(11); // delete item with key 11

theList.displayForward(); // display list forward

theList.insertAfter(22, 77); // insert 77 after 22
theList.insertAfter(33, 88); // insert 88 after 33

theList.displayForward(); // display list forward
} // end main()
} // end class DoublyLinkedApp

____________________________________________________________________________________________________________________________________________________

In: Computer Science

3. Plot the below scores using the most appropriate type of graph. The goal is to...

3. Plot the below scores using the most appropriate type of graph. The goal is to see how these bowlers have performed over time.

Day

1

2

3

4

5

6

7

8

9

10

Bob

111

133

122

144

124

155

133

166

133

147

Ted

89

99

111

121

133

133

124

122

120

155

Carol

144

145

133

155

166

133

177

188

179

157

Alice

166

177

184

168

147

198

167

178

187

201

4. Plot the scores below for the bowler's scores as a function of their ages. The goal is to see a relationship between two variables...scores vs. ages. Also, create a list according to their ages (oldest first), then their scores (highest first), then their names (alphabetically).

Name

Age

Score

Matilda

11

121

Gretel

21

204

Gertrude

15

144

Frances

7

34

Winifred

33

220

Heather

26

215

Esther

9

55

Beulah

17

155

Marnie

29

178

Ilse

14

98

5. Graph the percentages of the students at a college:
         Freshmen = 40%, Sophomores = 30%, Juniors = 20%, Seniors = 10%

6. Make a spread sheet that calculates your grades in this class.

In: Statistics and Probability

You are studying to enter professions that require high moral and ethical behavior. Your commitment to...

You are studying to enter professions that require high moral and ethical behavior. Your commitment to such standards should begin in this class and continue through every class in your graduate degree program. This week's discussion questions:
1) Why ethics and professional conduct are so important in the accounting professions, and
2) Why behaving ethically in your graduate studies is critical to your goal to graduate and work in the accounting industry.

Some major professional accounting associations/organizations include:

American Accounting Association

American Institute of CPA's

American Society of Women Accountants

American Taxation Association

Association of Certified Fraud Examiners

Association of Government Accountants

Chartered Global Management Accountants

Information Systems Audit and Control Association

Institute of Internal Auditors

Institute of Management Accountants

Institute of Industrial Accountants

Insurance Accounting and Systems Association

International Association of Accounting Education

National Association of Black Accountants

National Society of Accountants

Professional Association of Small Business Accountants

Professional Accounting Society of America

Your state" Society of CPA's

Questions to spark class discussion:

Randomly select one of the professional accounting organizations from the list below.

Summarize and discuss the professional code of ethics of the organization you selected.

Identify a few of the key codes and or responsibilities of ethical and professional conduct in this organization.

Discuss their importance and how you, as students can model these behaviors.

In: Accounting