Questions
Python Write a function str_slice(s) to slice sentence into single word by their spaces and punctuations...

Python
Write a function str_slice(s) to slice sentence into single word by their spaces and punctuations and returns a list.
You cannot use split(), join() method for this define function
Example:
>>>str_slice(‘Hi, I like it!!’)
[‘Hi’, ‘, ’, 'I', ‘ ‘, ‘like’, ‘ ‘, ‘it’, ‘!!’]

In: Computer Science

Based on your reading style, how could you have learned material better, how could you apply...

Based on your reading style, how could you have learned material better, how could you apply this information? Give an example of how you did or could have applied this information. 250 word initial response.

In: Psychology

Question 2: Further Aspects of Budgeting and Variance Analysis-Sales mix and volume variance                            

Question 2: Further Aspects of Budgeting and Variance Analysis-Sales mix and volume variance                                                                                                                                                                                  

Jack plc makes and sells three types of fan for which the following budget/standard information and actual information are available for a four-week period.

Model

Budgeted sale (unit)

Standard unit data

Selling price ($)

Variable cost ($)

Actual sales (unit)

Superb

5,000

15

1.0

8,000

Excellent

15,000

14

2.0

11,000

Good

5,000

13

1.0

4,000

Budgeted fixed costs are $250,000 for the four-week period. Jack plc allocates fixed costs on the basis of budgeted units of sale in calculating expected net profit.

Required 2.1

Calculate the sales mix and sales quantity variances for each model for the four-week period by using expected net profit as the variance valuation basis.                                       

Your answer:

Show your workings here (Use table if necessay. Expand the space as required):

Sales mix variance

Sales quantity variance                                                                                                          

Add/delete row or coloumn if necessary

Required 2.2

Explain why managers need to divide sales volume variance into sales mix and sales quantity variances calculated in requirement (I).                                                                                

Word limit: 100 words. Note the word count at the end of your answer]

Your answer (expand the space here):

Word count=

In: Accounting

Write a Java program that prompts the user to input a string and prints whether it...

Write a Java program that prompts the user to input a string and prints whether it is a palindrome. A palindrome is a string which reads the same backward as forward, such as Madam (disregarding punctuation and the distinction between uppercase and lowercase letters). The program must use the stack data structure.


The program must include the following classes:
The StackX class (or you can use the Java Stack class).
The Palindrome class which must contain a method named palindrome() of type boolean. The method must return true if the string is a palindrome and false otherwise.


The Test class which must contain the main method. In the main method, you must prompt the user to input a string and print “The string is a palindrome” if the inputted string is a palindrome. Otherwise, you must print “The string is not a palindrome.”

Here is a sample run:
Enter a word: Madam
The string is a palindrome
Here is another sample run:
Enter a word: Able was I, ere I saw Elba.
The string is a palindrome
Here is another sample run:
Enter a word: Data Structures.
The string is not a palindrome

======================================================================================

public class StackX {

private long [] stackArray ;

private int top ;

public StackX ( int size )

{

stackArray = new long [ size ]; // create the stack

top = -1; // set the top to -1

}

public void push ( long j ) {

stackArray [++ top ] = j ; // increment top , insert item

}

public long pop ()

{

return stackArray [ top - -]; // access item , decrement top

}

In: Computer Science

Participants saw a series of words on a computer screen. Each time, a word (either relating...

  1. Participants saw a series of words on a computer screen. Each time, a word (either relating to a positive emotion or a negative emotion) was presented on a screen for 1500ms. Researchers asked participants to press the “A” key as quickly as possibly if they saw a positive word and the “L” key if they saw a negative word. The response is reaction time in milliseconds (i.e., how long it took the subject to make a response). Use an appropriate test statistical method to answer the question: Did the reaction time differ between the two types of words?

Subjects

Positive

Negative

1

500

490

2

540

540

3

340

350

4

540

580

5

480

500

6

465

490

7

400

450

8

440

450

9

430

420

10

435

450

Please resolve the following questions:

  1. Identify the independent variable and its associated levels, as well as the dependent variable. (12 pts)
  2. Identify the statistical test to be used. (4 pts)
  3. State the null and alternative hypothesis. (6 pts)
  4. Determine the critical value(s). (4 pts)
  5. Calculate the value of your test statistic from the data. (24 pts)
  6. Draw a distribution showing your critical regions and test statistic. (7 pts)
  7. Make a statistical decision for the hypotheses. (6 pts)
  8. Interpret the results and answer/validate the research question - Did the reaction time differ between the two types of words? (12 pts)

In: Statistics and Probability

. Consider the 68 words in the following two sentences to be modeled as random variables....

. Consider the 68 words in the following two sentences to be modeled as random variables. The sentences contain words of 1 letter length to 10 letter length. Thus random variable x lies in the range 1 ≤ x ≤ 11

        “A single link flexible arm is a dynamic system with the first eigenvalue equal to zero and giving the primary rigid body motion and the eigenvalues greater than zero giving flexural vibration that may occur during the response. The object is to drive the arm tip to a constant steady state position in as fast a time as possible while keeping the arm tip vibration to a minimum.”

(A) Develop a bar graph for the number of words with a specific number of letters.

For example, in the phrase “This is an example for the type of words related to this problem”:   3 two letter words, 2 three letter words, 3 four letter words, 1 five letter word, 3 seven letter words.

(B) Calculate the probability density distribution and show it bar form. Use 1 for the transition from probability to probability density which makes these two the same.

(C)    Determine the mean μ and standard deviation σ.

(D)   Use part B result and determine the probability that a word falls between

            μ-σ and μ+σ.

   (E) If the system is modeled with a continuous normal probability distribution, determine the probability that a word falls between 6 and 9 letters.

In: Statistics and Probability

1. When a file is created on Linux Operating System, What are the default permissions of...

1. When a file is created on Linux Operating System, What are the default permissions of the file?

2. Write a command to find the total disk space used by a specific user on linux system?

3. What is "s" permission bit in a file?

4. Explain the difference between grep and egrep?

5. Write a command to list files where third letter is x or y?

6. Write command to remove array element with id 5?

7. Write a shell script that adds an extension “.deb” to all the files in a directory.

8. Write a command sequence or a script to insert a line “GHIJKLM” at every 10th line of a file?

9. Write a bash command or script to find all the files modified in less than 5 days and print the record count of each.

10. Explain the difference between $* and $@?

11. Given a file, replace all occurrence of word “DEF” with “ABC” from 5th line till end in only those lines that contains word “MNO”

12. Explain the difference between $$ and $!?

13. Write a bash command sequence to read all input to the command from file1 direct all output to file2 and error to file 3, how can I achieve this?

14. Write a bash command to find the count of lines containing word “CAT”.

15. What are the 3 standard streams in Linux?

In: Computer Science

Working in a technical field can be confusing because of all the acronyms. For example, CPU...

Working in a technical field can be confusing because of all the acronyms. For example, CPU means Central Processing Unit, HDMI means High-Definition Multimedia Interface, and SMART means Self-Monitoring Analysis and Reporting Technology. Wouldn't it be nice if there was a way to translate all these acronyms automatically?

Create a new file named Translate.java that contains the following method:

public static String expandAll(String[] acronyms, String[] definitions, String text)

This method should replace every instance of an acronym in the text with its corresponding definition. For example, expandAll({"JMU", "CS"}, {"James Madison University", "Computer Science"}, "JMU CS rocks!") would return the string "James Madison University Computer Science rocks!".

You may assume that the two arrays will be the same length. You may also assume that the text will be reasonable English with correct grammar. In particular, there will be only one space between each word. Each sentence will either end with a space or a newline character. Punctuation not at the end of the sentence will always be followed by whitespace (i.e., you should be able to handle "Hi, Mom" but you won't have to handle "Hi,Mom").

Be careful not to replace acronyms in the middle of a word. For example, the string "CS uses MACS!" should expand to "Computer Science uses MACS!", not "Computer Science uses MAComputer Science!". You might find it helpful to use a Scanner to process the string one word at a time.

In: Computer Science

Pattern matching using python3 re module Write a regular expression that will find out all the...

Pattern matching using python3 re module

Write a regular expression that will find out all the words that ends with 4 consecutive vowels at the end.

Example: import re

f=open("/usr/share/dict/american-english",'r')

pattern='a[a-z]*d$'

words=f.readlines()

matchlist=[word for word in words if re.match(pattern,word)]

===============================

Generate random string follow a specific pattern

You will take a username and ask user for the password. User has to enter a strong password in order to create his or her account. The criteria for strong password is, a) Starts with a letter a to z or A to Z b) Cannot end with a digit c) Total character should be 10 d) The character can be letter a to z or A to Z or digit 0 to 9 or _

You will show a message that account is successfully created if user enters a strong password. If a user does not enter a strong password, you will reject the user entered password and generate a strong password as follows: a) Starts with the first character of the user’s user name b) Ends with the last character of the user’s user name c) Total character should be 10 d) The character can be letter a to z or A to Z or digit 0 to 9 or _

Sample output: Account is successfully created

Another sample output: Week Password

Generating a Strong Password

The auto generated password: j57m9XoUGa

In: Computer Science

Your textbook mentions that relational operators can be used to compare letters and words, thanks to...

Your textbook mentions that relational operators can be used to compare letters and words, thanks to ASCII. This simple program will ask the user to enter two letters and then two words to see if we can really "sort" these entries alphabetically with relational operators.

Prompts:

This is a Letter and Word sorting program
Enter two different letters separated by a space: [assume user inputs: b a]

Enter two different words separated by a space: [assume user inputs: bob alex]

Output:

a goes before b
alex goes before bob

Notes and Hints:

1) Do NOT convert the user's entry to uppercase. Some of the test cases will be comparing lowercase to uppercase letters (the results are interesting!)

2) Don't worry about the possibility of the user entering the same letters/words or entering something else. Keep this program simple.

// VARIABLES
  

// INITIAL INPUT
cout << "This is a Letter and Word sorting program" << endl;
cout << "Enter two different letters separated by a space: ";
  
cout <<endl; // For Mimir
cout << "Enter two different words separated by a space: ";
  
cout << endl; // For Mimir

//Processing// LETTER ANALYSIS
// The < means letter1 is alphabetically before letter2
cout << letter1 << " goes before " << letter2 <<endl;
  
cout << letter2 << " goes before " << letter1 << endl;

// WORD ANALYSIS
// The < means word1 is alphabetically before word2
cout << word1 << " goes before " << word2 << endl;
cout << word2 << " goes before " << word1 << endl;

In: Computer Science