Questions
A professor at a local university designed an experiment to see if someone could identify the...

A professor at a local university designed an experiment to see if someone could identify the color of a candy based on taste alone. Students were blindfolded and then given a​ red-colored or​ yellow-colored candy to chew.​ (Half the students were assigned to receive the red candy and half to receive the yellow candy. The students could not see what color candy they were​ given.) After​ chewing, the students were asked to guess the color of the candy based on the flavor. Of the

122122


students who participated in the​ study,

7878

correctly identified the color of the candy. The results are shown in the accompanying technology printout. Complete parts a through c below.

LOADING...

Click the icon to view the technology printout.

a. If there is no relationship between color and candy​ flavor, what proportion of the population of students would correctly identify the​ color?


The proportion would be

0.50.5.

​(Type an integer or a​ decimal.)

b. Specify the null and alternative hypotheses for testing whether color and flavor are related. Choose the correct hypotheses below.

A.

Upper H 0 : p equals 0.50 vs. Upper H Subscript a Baseline : p greater than 0.50H0: p=0.50 vs. Ha: p>0.50

B.

Upper H 0 : p equals 0.50 vs. Upper H Subscript a Baseline : p less than 0.50H0: p=0.50 vs. Ha: p<0.50

C.

Upper H 0 : p not equals 0.50 vs. Upper H Subscript a Baseline : p equals 0.50H0: p≠0.50 vs. Ha: p=0.50

Your answer is not correct.

D.

Upper H 0 : p less than 0.50 vs. Upper H Subscript a Baseline : p equals 0.50H0: p<0.50 vs. Ha: p=0.50

E.

Upper H 0 : p equals 0.50 vs. Upper H Subscript a Baseline : p not equals 0.50H0: p=0.50 vs. Ha: p≠0.50

This is the correct answer.

F.

Upper H 0 : p greater than 0.50 vs. Upper H Subscript a Baseline : p equals 0.50H0: p>0.50 vs. Ha: p=0.50

c.

Carry out the test and give the appropriate conclusion at

alphaαequals=0.010.01.

Use the​ p-value of the​ test, shown on the accompanying technology​ printout, to make your decision.

The​ p-value is

0.0020.002.

​(Type an integer or a​ decimal.)

Make the appropriate conclusion using

alphaαequals=0.010.01.

A.

RejectReject

the null​ hypothesis, because the​ p-value is

not less thannot less than

alphaα.

There is

insufficientinsufficient

evidence to conclude that color and flavor are related.

B.

Do not rejectDo not reject

the null​ hypothesis, because the​ p-value is not

not less thannot less than

alpha

In: Statistics and Probability

Complete the program to read in values from a text file. The values will be the...

Complete the program to read in values from a text file. The values will be the scores on several assignments by the students in a class. Each row of values represents a specific student's scores. Each column represents the scores of all students on a specific assignment. So a specific value is a specific student's score on a specific assignment. The first two values in the text file will give the number of students (number of rows) and the number of assignments (number of columns), respectively.

For example, if the file contains:

3
4
9 6 10 5
2 2 0 0
10 10 9 10

then it represents the scores for 3 students on 4 assignments as follows:

Assignment 1 Assignment 2 Assignment 3 Assignment 4
Student 1 9 6 10 5
Student 2 2 2 0 0
Student 3 10 10 9 10

The program should:

1) Read in the first two values to get the number of students and number of assignments. Create a two-dimensional array of integers to store all the scores using these dimensions.

2) Read in all the scores into the 2-D array.

3) Print the whole array, row by row on separate lines, using Arrays.toString() on each row of the array

3) Print the average of the scores on each assignment. For example, if the data is given in the above example, the output would be:

Array of scores:
[9, 6, 10, 5]
[2, 2, 0, 0]
[10, 10, 9, 10]


Average score of each assignment:
Assignment #1 Average = 7.0
Assignment #2 Average = 6.0
Assignment #3 Average = 6.333333333333333
Assignment #4 Average = 5.0

Starter Code:

import java.util.Scanner;
import java.io.File; //needed to open the file
import java.io.FileNotFoundException; //needed to declare possible error when opening file
import java.util.Arrays; //for the Arrays.toString() method

public class Scores {
public static void main(String[] args) throws FileNotFoundException {
//create a Scanner to get input from the keyboard to ask the user for the file name
Scanner keyboard = new Scanner(System.in);
System.out.println("What is the name of the file containing the scores?");
//create another Scanner to read from the file
String fileName = keyboard.nextLine();
Scanner fileScan = new Scanner(new File(fileName));
  
  
  
//TODO: read in the values for the number of students and number of assignments using the Scanner on the file
  
//TODO: create a 2-D to store all the scores and read them all in using the Scanner on the file
  
System.out.println("Array of scores:");
//TODO: print the entire array, row by row, using Arrays.toString()
  
System.out.println("Average score of each assignment:");
//TODO: compute and print the average on each assignment

In: Computer Science

I'm getting an error for this code? it won't compile import java.util.*; import java.io.*; public class...

I'm getting an error for this code? it won't compile

import java.util.*;
import java.io.*;

public class Qup3 implements xxxxxlist {// implements interface
   // xxxxxlnk class variables
   // head is a pointer to beginning of rlinked list
   private node head;
   // no. of elements in the list
   // private int count;

// xxxxxlnk class constructor
   Qup3() {
       head = null;
       count = 0;
   } // end Dersop3 class constructor

   PrintStream prt = System.out;

   // class node
   private class node {
       // class node variables
       int data;
       node rlink;

       // class node constructor
       node(int x) {
           data = x;
           rlink = null;
       } // class node constructor
   } // end class node

   // isEmpty() returns true if list is empty, false otherwise.
   public boolean isEmpty() {
       return (count == 0);
   } // end isEmpty

   // length() returns number of list elements.
   public int length() {
       return count;
   } // end length

   // insert x at position p, for successful insertion:
   // list should not be full and 1 <= p <= count+1
   public int insert(int x, int p) {
       int i;
       prt.printf("\n Insert %4d at position %2d:", x, p);
      
       if (p < 1 || p > ( count + 1) ) {
           return 0;
       }
       node tmp = new node(x);
       // p == 1 Inserts x to front of list,
       // is a special case where head changes
       if (p == 1) {
           tmp.rlink = head;
           head = tmp;
       } else {// traverse the list till element before p
           node current = head;
           // Find node before p
           for (i = 2; i < p; i++, current = current.rlink)
               ; // end for
           // insert node after cur node
           tmp.rlink = current.rlink;
           current.rlink = tmp;
       }
       count++;
       return 1; // successful insertion
   } // end insert

   // delete x at position p, for successful deletion:
   // list should not be empty and 1 <= p <= count
   public int delete(int p) {
       prt.printf("\n Delete element at position %2d:", p);
       if (isEmpty() || p < 1 || p > length())
           return 0; // invalid deletion
       int count = length();
       node tmp = head;
       // p == 1 deletes front of list.
       // This is a special case where head changes
       if (p == 1) { // Delete Front of List
           head = head.rlink;
           tmp.rlink = null;
           } else { // Find node before p
           node current = head;
           for (int i = 2; i < p; i++, current = current.rlink; ) ;// end for
           // Delete node after current node
           tmp = current.rlink;
           current.rlink = tmp.rlink;
           tmp.rlink = null; // delete tmp;
           }
       count--;
       return 1; // successful deletion
   } // end delete

   // sequential serach for x in the list
   // if successful return position of x in the
   // list otherwise return 0;
   public int searchx(int x) {
       prt.printf("\n search for %4d:", x);
       // complete the rest
       //.........
       return 0;
   } // end searchx

   // print list elements formatted
   public void printlist() {
       prt.print("\n List contents: ");
       for (node current = head; current != null; current = current.rlink)
           prt.printf("%4d, ", current.data);
      
       // end for
   } // end printlist

   public static void main(String args[]) throws Exception {
       int j, m, k, p, x, s;
       try {
           // open input file
           Scanner inf = new Scanner(System.in);
           // Create a List of type Integer of size n
           Qup3 lst = new Qup3();

           // read no. of elements to insert
           m = inf.nextInt();
           System.out.printf("\n\tInsert %2d elements in the list.", m);
           for (j = 1; j <= m; j++) {
               x = inf.nextInt(); // read x
               p = inf.nextInt(); // read position

               s = lst.insert(x, p); // insert x at position p
               if (s == 1)
                   System.out.printf(" Successful insertion.");
               else
                   System.out.printf(" %2d is invalid position for insertion.", p);
           } // end for
           lst.printlist(); // print linked list elements
           // read no. of elements to search in the list
           m = inf.nextInt();
           System.out.printf("\n\tSearch for %d elements in the list.", m);
           for (j = 1; j <= m; j++) {
               x = inf.nextInt(); // read x
               p = lst.searchx(x); // search for x
               if (p > 0)
                   System.out.printf(" found at position %d.", p);
               else
                   System.out.printf(" is not found.");
           } // end for
               // read no. of positions to delete from list
           m = inf.nextInt();
           System.out.printf("\n\tDelete %d elements from list.", m);
           for (j = 1; j <= m; j++) {
               p = inf.nextInt(); // read position
               s = lst.delete(p); // delete position p
               if (s == 1)
                   System.out.printf(" Successful deletion.");
               else
                   System.out.printf(" %2d is invalid position for deletion.", p);
           } // end for
           lst.printlist(); // print array elements
           inf.close(); // close input file
      
       } catch (Exception e) {
           System.out.print("\nException " + e + "\n");
       }
   System.out.print("\tAuthor: G. Dastghaibyfard \tDate: " +

java.time.LocalDate.now());} // end main
} // end class xxxxxlnk

In: Computer Science

Programming Project 3 Home Sales Program Behavior This program will analyze real estate sales data stored...

Programming Project 3

Home Sales

Program Behavior

This program will analyze real estate sales data stored in an input file. Each run of the program should analyze one file of data. The name of the input file should be read from the user.

Here is a sample run of the program as seen in the console window. User input is shown in blue:

Let's analyze those sales!

Enter the name of the file to process? sales.txt

Number of sales: 6

Total: 2176970

Average: 362828

Largest sale: Joseph Miller 610300

Smallest sale: Franklin Smith 199200

Now go sell some more houses!

Your program should conform to the prompts and behavior displayed above. Include blank lines in the output as shown.

Each line of the data file analyzed will contain the buyer's last name, the buyer's first name, and the sale price, in that order and separated by spaces. You can assume that the data file requested will exist and be in the proper format.

The data file analyzed in that example contains this data:

Cochran Daniel 274000
Smith Franklin 199200
Espinoza Miguel 252000
Miller Joseph 610300
Green Cynthia 482370
Nguyen Eric 359100

You can download that sample data file here to test your program, but your program should process any data file with a similar structure. The input file may be of any length and have any filename. You should test your program with at least one other data file that you make.

Note that the average is printed as an integer, truncating any fractional part.

Your program should include the following functions:

read_data - This function should accept a string parameter representing the input file name to process and return a list containing the data from the file. Each element in the list should itself be a list representing one sale. Each element should contain the first name, last name, and purchase price in that order (note that the first and last names are switched compared to the input file). For the example given above, the list returned by the read_data function would be:

[['Daniel', 'Cochran', 274000], ['Franklin', 'Smith', 199200], ['Miguel', 'Espinoza', 252000], ['Joseph', 'Miller', 610300], ['Cynthia', 'Green', 482370], ['Eric', 'Nguyen', 359100]]

Use a with statement and for statement to process the input file as described in the textbook.

compute_sum - This function should accept the list of sales (produced by the read_data function) as a parameter, and return a sum of all sales represented in the list.

compute_avg - This function should accept the list of sales as a parameter and return the average of all sales represented in the list. Call the compute_sum function to help with this process.

get_largest_sale - This function should accept the list of sales as a parameter and return the entry in the list with the largest sale price. For the example above, the return value would be ['Joseph', 'Miller', 610300].

get_smallest_sale - Like get_largest_sale, but returns the entry with the smallest sale price. For the example above, the return value would be ['Franklin', 'Smith', 199200].

Do NOT attempt to use the built-in functions sum, min, or max in your program. Given the structure of the data, they are not helpful in this situation.

main - This function represents the main program, which reads the file name to process from the user and, with the assistance of the other functions, produces all output. For this project, do not print output in any function other than main.

Other than the definitions of the functions described above, the only code in the module should be the following, at the end of the file:

if __name__ == '__main__':
main()

That if statement keeps your program from being run when it is initially imported into the Web-CAT test environment. But your program will run as normal in Thonny. Note that there are two underscore characters before and after name and main.

Include an appropriate docstring comment below each function header describing the function.

Do NOT use techniques or code libraries that have not been covered in this course.

Include additional hashtag comments to your program as needed to explain specific processing.

A Word about List Access

A list that contains lists as elements operates the same way that any other lists do. Just remember that each element is itself a list. Here's a list containing three elements. Each element is a list containing integers as elements:

my_list = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]

So my_list[0] is the list [1, 2, 3, 4] and my_list[2] is [9, 10, 11, 12].

Since my_list[2] is a list, you could use an index to get to a particular value. For instance, my_list[2][1] is the integer value 10 (the second value in the third list in my_list).

In this project, the sales list is a list of lists. When needed, you can access a particular value (first name, last name, or sales price) from a particular element in the sales list.

In: Computer Science

Long Integer Addition For this assignment you are to write a class that supports the addition...

Long Integer Addition

For this assignment you are to write a class that supports the addition of extra long integers, by using linked-lists. Longer than what is supported by Java's built-in data type, called long.

Your program will take in two strings, consisting of only digits, covert each of them to a linked-list that represents an integer version on that string. Then it will create a third linked-list that represents the sum of both of the linked lists. Lastly, it will print out the result of the sum.

Conceptual Example
For the string: "12", create a list: head->1->2->null
For the string: "34", create a list: head->3->4->null
Add the two lists to create a third list: head->4->6->null
print the resulting linked list as "46"
Where "->" represents a link.

Keep in mind that the conceptual example above is conceptual. It does suggest a certain implementation. However as you read on you will see that you have several options for implementing your solution. You need not use the suggested implementation above.

For this class you are to implement a minimum of three methods. They are:

  1. A method called makeSDList() that takes in a string, consisting only of digits, as an argument, and creates and returns a linked-link representation of the argument string.

    The method has the following header:

    SDList makeSDList(String s) { }

    where s is a string, and SDList is the class name of the linked list.  

  2. A method called addLists() that takes takes two lists, adds them together, and creates and returns a list that represents the sum of both argument lists.

    The method has the following header:

    SDList addLists(SDList c) { }

    wherec  linked-list of type SDList .

  3. A method called displayList() that takes takes a list, prints the value of each digit of the list.  

    The method has the following header:

    void displayList() { }

Programming Notes

  1. You need not add any methods you don't need.
  2. You can add any methods use wish.
  3. You can use any type of linked list like: singly-linked, doubly-linked, circular, etc.
  4. You can choose you own list implementation such-as with or without sentinels, with head and/or tail points, etc.
  5. Do not assume any maximum length for either addend.
  6. You can assume that an each addend is a least one digit long.
  7. You need not test for the null or empty string ("") cases.
  8. The addends need not be the same length.

Programming Rules:

  1. You are not allowed to change the signature of the three methods above.
  2. You are not allowed to use arrays or ArrayLists anywhere in your solution.
  3. You are not allowed to use any Java built-in (ADTs), such as Lists, Sets, Maps, Stacks, Queues, Deques, Trees, Graphs, Heaps, etc. Or make any class that inherits any of those ADTs.
  4. You are to create your own node and list class. For your node and list class you can use the code that was used in the book, video and lecture notes related to the node and lists class examples.
  5. You are only allowed to have one class for your nodes and one class for your lists.
  6. You are not allowed to use Java Generics.
  7. You can use any data type to represent the digits (in the node). However, each node must represent one and only one digit.
  8. If hard-coding detected in any part of your solution your score will be zero for the whole assignment.

Submission Rules:

1. Submit only one Homework5.java file for all test cases. The starter file is names Homework5a.java so you will need rename the file before you begin submitting your solution.

2. Anything submitted to Mimir is considered to be officially submitted to me and is considered to be 100% your work. Even if it is not your last planned submission.

3. Any extra testing code that you wrote and used to do your own testing should be deleted from the file that gets used in the final grading. I emphasize the word deleted. Commenting out code is not sufficient and not considered deleted. It must be completely removed. English comments written to explain your code are perfectly fine.

STARTER CODE

import java.util.Scanner;  // Import the Scanner class

public class Homework5a {

  

  public static void main(String[] args) {

    SDList x, y, z;

    String a, b;

    Scanner input = new Scanner(System.in);  // Create a Scanner object

    System.out.print("A: ");

    a = input.nextLine();

    x = makeSDList(a);               // convert first string to a linked list

    x.displayList();                 // call function that displays list x

    System.out.print("B: ");   

    b = input.nextLine();

    y = makeSDList(b);               // convert second string to a linked list

    y.displayList();                 // call function that displays list z

    z = x.addLists(y);               // add lists x & y and store result in list y

    System.out.print("A+B: ");

    z.displayList();                 // call function that displays list z

  }

   

  public static SDList makeSDList(String s) {

  // put your solution here

    return null;

  }

}

class SDList {

  // put your solution here

  

  public SDList addLists(SDList c) {   

  // put your solution here

    return null; //replace if necessary

  }

  

  public void displayList() {

  // put your solution here

  }

}

In: Computer Science

Program Behavior This program will analyze real estate sales data stored in an input file. Each...

Program Behavior

This program will analyze real estate sales data stored in an input file. Each run of the program should analyze one file of data. The name of the input file should be read from the user.

Here is a sample run of the program as seen in the console window. User input is shown in blue:

Let's analyze those sales!

Enter the name of the file to process? sales.txt

Number of sales: 6

Total: 2176970

Average: 362828

Largest sale: Joseph Miller 610300

Smallest sale: Franklin Smith 199200

Now go sell some more houses!

Your program should conform to the prompts and behavior displayed above. Include blank lines in the output as shown.

Each line of the data file analyzed will contain the buyer's last name, the buyer's first name, and the sale price, in that order and separated by spaces. You can assume that the data file requested will exist and be in the proper format.

The data file analyzed in that example contains this data:

Cochran Daniel 274000
Smith Franklin 199200
Espinoza Miguel 252000
Miller Joseph 610300
Green Cynthia 482370
Nguyen Eric 359100

You can download that sample data file here https://drive.google.com/file/d/1bkW8HAvPtU5lmFAbLAJQfOLS5bFEBwf6/view?usp=sharing to test your program, but your program should process any data file with a similar structure. The input file may be of any length and have any filename. You should test your program with at least one other data file that you make.

Note that the average is printed as an integer, truncating any fractional part.

Your program should include the following functions:

read_data - This function should accept a string parameter representing the input file name to process and return a list containing the data from the file. Each element in the list should itself be a list representing one sale. Each element should contain the first name, last name, and purchase price in that order (note that the first and last names are switched compared to the input file). For the example given above, the list returned by the read_data function would be:

[['Daniel', 'Cochran', 274000], ['Franklin', 'Smith', 199200], ['Miguel', 'Espinoza', 252000], ['Joseph', 'Miller', 610300], ['Cynthia', 'Green', 482370], ['Eric', 'Nguyen', 359100]]

Use a with statement and for statement to process the input file as described in the textbook.

compute_sum - This function should accept the list of sales (produced by the read_data function) as a parameter, and return a sum of all sales represented in the list.

compute_avg - This function should accept the list of sales as a parameter and return the average of all sales represented in the list. Call the compute_sum function to help with this process.

get_largest_sale - This function should accept the list of sales as a parameter and return the entry in the list with the largest sale price. For the example above, the return value would be ['Joseph', 'Miller', 610300].

get_smallest_sale - Like get_largest_sale, but returns the entry with the smallest sale price. For the example above, the return value would be ['Franklin', 'Smith', 199200].

Do NOT attempt to use the built-in functions sum, min, or max in your program. Given the structure of the data, they are not helpful in this situation.

main - This function represents the main program, which reads the file name to process from the user and, with the assistance of the other functions, produces all output. For this project, do not print output in any function other than main.

Other than the definitions of the functions described above, the only code in the module should be the following, at the end of the file:

if __name__ == '__main__':
main()

That if statement keeps your program from being run when it is initially imported into the Web-CAT test environment. But your program will run as normal in Thonny. Note that there are two underscore characters before and after name and main.

Include an appropriate docstring comment below each function header describing the function.

Do NOT use techniques or code libraries that have not been covered in this course.

Include additional hashtag comments to your program as needed to explain specific processing.

A Word about List Access

A list that contains lists as elements operates the same way that any other lists do. Just remember that each element is itself a list. Here's a list containing three elements. Each element is a list containing integers as elements:

my_list = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]

So my_list[0] is the list [1, 2, 3, 4] and my_list[2] is [9, 10, 11, 12].

Since my_list[2] is a list, you could use an index to get to a particular value. For instance, my_list[2][1] is the integer value 10 (the second value in the third list in my_list).

In this project, the sales list is a list of lists. When needed, you can access a particular value (first name, last name, or sales price) from a particular element in the sales list.

In: Computer Science

Choose two of your favorite foods that contain over 100mg of sodium. List them with the sodium intake

several meal planning tools are available for a diabetic client to use. If you were diagnosed with diabetes, which food plan would work best for your lifestyle? Research the various diet and meal plans and defend your answer. Include one to two references with sources cited throughout posting and reference in reference list.

2. Choose two of your favorite foods that contain over 100mg of sodium. List them with the sodium intake (cite your references and include in a reference list at the end of the posting). Then list a suitable substitute (cite your references and include in reference list) to decrease sodium intake.  

Could you live with this substitute if you were a newly diagnosed client with hypertension? Describe how this activity will help you better prepare to be a client educator in this field now and when you graduate. Be sure to use a different reference than what was used in the first topic. At least two reference


In: Nursing

QUESTION 5 Recognition and recall tasks both ask subjects to __________ information.   retrieve encode acquire store...

QUESTION 5

Recognition and recall tasks both ask subjects to __________ information.  

retrieve

encode

acquire

store

QUESTION 6

In considering the Serial Position Effect, the “primacy effect” refers to the fact that

the items presented most recently in a list are more likely to be remembered than items presented earlier.

the most important items in a list are more likely to be remembered than less important items.

those items in a list which have the greatest emotional impact are those with the greatest likelihood of recall.

the first-presented items in a list are more likely to be remembered than items in the middle of the list.

QUESTION 7

According to psychoanalytic theory, __________ is occurring when memories or impulses that give rise to anxiety are pushed out of consciousness.

rationalization

repression

aggression

catharsis

QUESTION 8

Which name was not influential in the development of psychology as a unique discipline?

William James

Franz Kafka

Ivan Pavlov

John B. Watson

In: Psychology

What is the meaning of Taxation as define in the unit? List and explain at least...

What is the meaning of Taxation as define in the unit?

List and explain at least 3 objectives of Taxation?

What is the difference between Progressive Tax System and Regressive Tax System?

List and 10 criteria of a Good Tax System?

Describe the 3 objectives of tax policy?

What is the meaning of Residence, Domicile and non-residence?

List at least 3 rules that are used to determine residence of an individual?

From a tax point of view what is the meaning of:

Sole Trader

An employee

A Partnership

A corporation

10. List and explain at least 3 powers of the Inland Revenue Department?

11. Employment income is comprised of?

12. List all the sources of income of an individual as noted in unit 3?

13. Define the following as per definitions given in unit 3?

Emolument

Non-emolument

Employer

Chargeable Income

Allowable Deductions

Personal allowance/Income Tax Threshold

Tax Credit

Capital Gain Tax

(Note post a new post)

In: Accounting

The purpose of this assignment is to use prefixes, suffixes, word roots, and combining vowels to build and define medical terms

 

Purpose: The purpose of this assignment is to use prefixes, suffixes, word roots, and combining vowels to build and define medical terms; to use basic medical language in written communication; and to interpret the meaning of medical terms used in written and verbal communication.

Action Items
1. Look through for English journal articles on human anatomy. Choose an article.
2. Select 5 medical terms from the article.
3. In the first column list the medical term.
4. In the second column, list any prefixes and define them.
5. In the third column, list the root and define it.
6. In the fourth column, list any suffixes and define them.
7. In the fifth column list the exact definition of the term.
8. Make sure to include references to the articles your terms come from.

**** i need just the table & Link your reference****

Medical Term

Prefixes

Roots

Suffixes

Exact Meaning

         
         
         
         
         

 

In: Anatomy and Physiology