VBA question, write a function check keyword in a string.
Question:
Function sentimentCalc(tweet As String) As Integer
This function should check each word in the tweet and if the word exists as one of the keywords in the positive list or negative list it should impact the overall sentiment value. The positive list and negative list words exist in the keywords sheet. Access the keywords as ranges within your VBA code. The case of the word is inconsequential. For instance, happy, HAPPY, or hApPy are all treated as positive words regardless of their case (Hint: StrComp).
We have a keyword excel show that which word is positive and which is negative. How to get the keyword please see the hit part below.
If the word is in the positive list, it should increase the sentiment value by 10, if it is in the negative list it should decrease it by 10.
For instance, if the positive list includes “happy”, “rally”, “growth” and the negative list includes “crash”, “scam”, “bad” then:
If the Tweet is “I am Happy that Bitcoin is showing growth.”. The sentiment value will be 10 + 10 = 20
If the Tweet is “I am happy that Bitcoin is a scam and will CRASH!” The sentiment value will be 10 – 10 – 10 = -10
You must remove the following punctuation characters from the tweet text in your VBA code before calculating the sentiment: ! . , ? : ) ( ;
You may do this using multiple lines each calling the Replace function or with an array, loop and one call to the Replace function. Both methods will be marked as correct.
HIT:
You will need to use the string functions StrCom p, Split and Replace In this function.To get the ranges from the keywords Sheet use Worksheet and Range object like so:
Dim positive As Range
Set positive = Worksheets("keywords").Range("A2:A76")
Dim negative As Range
Set negative = Worksheets("keywords").Range("B2:B76")
This will give you the range A2:A76.From the sheet namedkeywords As the variable named positive.You can do the same for the negative range (but with different cell references And variable names).
You will need to use nested loops. One to go through each word in the keywords and one to Go through each word in the tweet text.
In: Computer Science
The Gourmand Cooking School runs short cooking courses at its small campus. Management has identified two cost drivers it uses in its budgeting and performance reports—the number of courses and the total number of students. For example, the school might run two courses in a month and have a total of 63 students enrolled in those two courses. Data concerning the company’s cost formulas appear below:
| Fixed Cost per Month | Cost per Course | Cost per Student |
|||||
| Instructor wages | $ | 2,970 | |||||
| Classroom supplies | $ | 280 | |||||
| Utilities | $ | 1,210 | $ | 50 | |||
| Campus rent | $ | 4,500 | |||||
| Insurance | $ | 2,000 | |||||
| Administrative expenses | $ | 3,700 | $ | 46 | $ | 7 | |
For example, administrative expenses should be $3,700 per month plus $46 per course plus $7 per student. The company’s sales should average $850 per student.
The company planned to run four courses with a total of 63 students; however, it actually ran four courses with a total of only 59 students. The actual operating results for September appear below:
| Actual | ||
| Revenue | $ | 50,650 |
| Instructor wages | $ | 11,160 |
| Classroom supplies | $ | 17,490 |
| Utilities | $ | 1,820 |
| Campus rent | $ | 4,500 |
| Insurance | $ | 2,140 |
| Administrative expenses | $ | 3,751 |
Required:
1. Prepare the company’s planning budget for September.
Prepare the company’s planning budget for September.
|
|||||||||||||||||||||||||||||||||
2. Prepare the company’s flexible budget for September.
Prepare the company’s flexible budget for September.
|
|||||||||||||||||||||||||||||||||
3. Calculate the revenue and spending
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In: Accounting
Professor Jennings claims that only 35% of the students at Flora
College work while attending school. Dean Renata thinks that the
professor has underestimated the number of students with part-time
or full-time jobs. A random sample of 83students shows that 38 have
jobs. Do the data indicate that more than 35% of the students have
jobs? Use a 5% level of significance.
What are we testing in this problem?
single mean
single proportion
(a) What is the level of significance?
State the null and alternate hypotheses.
H0: p = 0.35; H1: p > 0.35
H0: μ = 0.35; H1: μ < 0.35
H0: p = 0.35; H1: p < 0.35
H0: μ = 0.35; H1: μ > 0.35
H0: p = 0.35; H1: p ≠ 0.35
H0: μ = 0.35; H1: μ ≠ 0.35
(b) What sampling distribution will you use? What assumptions are
you making?
The standard normal, since np > 5 and nq > 5.
The Student's t, since np < 5 and nq < 5.
The Student's t, since np > 5 and nq > 5.
The standard normal, since np < 5 and nq < 5.
What is the value of the sample test statistic? (Round your answer
to two decimal places.)
(c) Find (or estimate) the P-value.
P-value > 0.250
0.125 < P-value < 0.250
0.050 < P-value < 0.125
0.025 < P-value < 0.050
0.005 < P-value < 0.025
P-value < 0.005
Sketch the sampling distribution and show the area corresponding to
the P-value.
(d) Based on your answers in parts (a) to (c), will you reject or
fail to reject the null hypothesis? Are the data statistically
significant at level α?
At the α = 0.05 level, we reject the null hypothesis and conclude the data are statistically significant.
At the α = 0.05 level, we reject the null hypothesis and conclude the data are not statistically significant.
At the α = 0.05 level, we fail to reject the null hypothesis and conclude the data are statistically significant.
At the α = 0.05 level, we fail to reject the null hypothesis and conclude the data are not statistically significant.
(e) Interpret your conclusion in the context of the
application.
There is sufficient evidence at the 0.05 level to conclude that more than 35% of the students have jobs.
There is insufficient evidence at the 0.05 level to conclude that more than 35% of the students have jobs.
In: Statistics and Probability
As you might expect, there has been a spirited discussion about which method is most effective in terms of the effectiveness of delivering course content, student and faculty acceptance of different modes of instruction and the cost to the state of using different delivery methods. As a result of this discussion, five questions have arisen that require the use of statistics to answer them. They are:
1. Does student learning as indicated by average grades suffer if they are taught using alternative modes of instruction: traditional in-class teaching, on-line learning, or mixed on-line/in-class method?
2. Do students have a preference for which type of learning to which they are exposed?
3. Is the acceptance of students of on-line methods independent of their majors?
4. Is the proportion of faculty members favoring on-line or mixed delivery the same for all colleges within the university?
5. Does the average amount of additional instructor time required to deliver courses on-line differ according to the type of courses?
1.) Independent samples Of the course grades of students who took classes using traditional in class presentations, students to take classes online and students taught using mixed methods have been collected. The data are shown in the jpeg of the table below. Use this data to conduct the appropriate hypothesis test to determine if there is any difference between the mean scores of the student populations that took different types of classes. Use Tukey-Kramer to determine where the significant differences are.
| In-Class | On-Line | Mixed |
| 80.8 | 83.8 | 74.9 |
| 84.1 | 78.4 | 78.1 |
| 87.2 | 81.1 | 81.2 |
| 76.8 | 70.7 | 71.3 |
| 90.3 | 78.4 | 83.9 |
| 79.8 | 78.1 | 73.7 |
| 83.1 | 77.8 | 77.2 |
Please provide a statistical analysis. You are required to submit the following information:
1.) The null and alternative hypotheses being tested.
2.) The Critical test statistic (F or Chi-Square) from the appropriate table. If it required using the Tukey- Kramer method, show the Q score from the table AND the critical value that you used to make your decisions. Also, specify which mean or means are not equal.
3.) The calculated value that you arrived at and the p-Value.
4.) Your decision, reject or do not reject.
5.) A separate part of the answer must be a memo sheet written in word that answers each of the 5 questions and explains why you answered as you did using the results of your statistical testing.
In: Statistics and Probability
Blue Bayou Middle School wants to raise money for a new sound
system for its auditorium. The primary fund-raising event is a
dance at which the famous disc jockey Kray Zee will play classic
and not-so-classic dance tunes. Grant Hill, the music and theater
instructor, has been given the responsibility for coordinating the
fund-raising efforts. This is Grant’s first experience with
fund-raising. He decides to put the eighth-grade choir in charge of
the event; he will be a relatively passive observer.
Grant had 500 unnumbered tickets printed for the dance. He left the
tickets in a box on his desk and told the choir students to take as
many tickets as they thought they could sell for $5 each. In order
to ensure that no extra tickets would be floating around, he told
them to dispose of any unsold tickets. When the students received
payment for the tickets, they were to bring the cash back to Grant,
and he would put it in a locked box in his desk drawer.
Some of the students were responsible for decorating the gymnasium
for the dance. Grant gave each of them a key to the money box and
told them that if they took money out to purchase materials, they
should put a note in the box saying how much they took and what it
was used for. After 2 weeks, the money box appeared to be getting
full, so Grant asked Lynn Dandi to count the money, prepare a
deposit slip, and deposit the money in a bank account that Grant
had opened.
The day of the dance, Grant wrote a check from the account to pay
Kray Zee. The DJ said, however, that he accepted only cash and did
not give receipts. So Grant took $200 out of the cash box and gave
it to Kray. At the dance, Grant had Dana Uhler working at the
entrance to the gymnasium, collecting tickets from students and
selling tickets to those who had not pre-purchased them. Grant
estimated that 400 students attended the dance.
The following day, Grant closed out the bank account, which had
$250 in it, and gave that amount plus the $180 in the cash box to
Principal Sanchez. Principal Sanchez seemed surprised that, after
generating roughly $2,000 in sales, the dance netted only $430 in
cash. Grant did not know how to respond.
Identify as many internal control weaknesses as you can in
this scenario, and suggest how each could be
addressed.
In: Accounting
Blue Bayou Middle School wants to raise money for a new sound system for its auditorium. The primary fund-raising event is a dance at which the famous disc jockey Kray Zee will play classic and not-so-classic dance tunes. Grant Hill, the music and theater instructor, has been given the responsibility for coordinating the fund-raising efforts. This is Grant’s first experience with fund-raising. He decides to put the eighth-grade choir in charge of the event; he will be a relatively passive observer. Grant had 500 unnumbered tickets printed for the dance. He left the tickets in a box on his desk and told the choir students to take as many tickets as they thought they could sell for $5 each. In order to ensure that no extra tickets would be floating around, he told them to dispose of any unsold tickets. When the students received payment for the tickets, they were to bring the cash back to Grant, and he would put it in a locked box in his desk drawer. Some of the students were responsible for decorating the gymnasium for the dance. Grant gave each of them a key to the money box and told them that if they took money out to purchase materials, they should put a note in the box saying how much they took and what it was used for. After 2 weeks, the money box appeared to be getting full, so Grant asked Lynn Dandi to count the money, prepare a deposit slip, and deposit the money in a bank account that Grant had opened. The day of the dance, Grant wrote a check from the account to pay Kray Zee. The DJ said, however, that he accepted only cash and did not give receipts. So Grant took $200 out of the cash box and gave it to Kray. At the dance, Grant had Dana Uhler working at the entrance to the gymnasium, collecting tickets from students and selling tickets to those who had not pre-purchased them. Grant estimated that 400 students attended the dance. The following day, Grant closed out the bank account, which had $250 in it, and gave that amount plus the $180 in the cash box to Principal Sanchez. Principal Sanchez seemed surprised that, after generating roughly $2,000 in sales, the dance netted only $430 in cash. Grant did not know how to respond. Identify as many internal control weaknesses as you can in this scenario, and suggest how each could be addressed.
In: Accounting
8.
All the real zeros of the given polynomial are integers. Find the zeros. (Enter your answers as a comma-separated list. Enter all answers including repetitions.)
P(x) = x3 + 6x2 − 32
x =
Write the polynomial in factored form.
P(x) =
9.
Find all rational zeros of the polynomial. (Enter your answers as a comma-separated list. Enter all answers including repetitions.)
P(x) = 4x4 − 45x2 + 81
x =
Write the polynomial in factored form.
P(x) =
10.
All the real zeros of the given polynomial are integers. Find the zeros. (Enter your answers as a comma-separated list. Enter all answers including repetitions.)
P(x) = x3 − 19x − 30
x =
Write the polynomial in factored form.
P(x) =
11.
All the real zeros of the given polynomial are integers. Find the zeros. (Enter your answers as a comma-separated list. Enter all answers including repetitions.)
P(x) = x3 − 9x2 + 27x − 27
x =
Write the polynomial in factored form.
P(x) =
12.
Find all rational zeros of the polynomial. (Enter your answers as a comma-separated list. Enter all answers including repetitions.)
P(x) = 9x3 + 9x2 − x − 1
| x | = |
Write the polynomial in factored form.
| P(x) | = |
13.
Find all the real zeros of the polynomial. Use the quadratic formula if necessary, as in Example 3(a). (Enter your answers as a comma-separated list. Enter all answers including repetitions.)
P(x) = 4x3 + 6x2 − 7x − 9
x =
14.
Find all rational zeros of the polynomial. (Enter your answers as a comma-separated list. Enter all answers including repetitions.)
P(x) = 9x3 − 13x + 4
| x | = |
Write the polynomial in factored form.
| P(x) | = |
In: Math
Write all your answers for this problem in a text file named aa.txt – for each problem write the problem number and your answer.
1.1 What type of object can be contained in a list (write the letter for the best answer)?
a. String b. Integer c. List d. String and Integer only e. String, Integer, and List can all be contained in a list
1.2 Which statement about the debugger is not correct? a. It is a powerful tool in PyCharm and it can help trace the execution of a program. b. You can set breakpoints in the code to indicate where the computer should pause execution. c. The debugger can step through the program execution, but you cannot see the value of a variable without using a print statement. d. The PyCharm debugger highlights the line it will execute next.
1.3 Binary search takes a smaller number of comparisons to run compared to linear search. However, binary search cannot always be used. What is required for binary search to work?
1.4 Write TRUE or FALSE regarding the following statement: “The Merge Sort algorithm we studied in Chapter 5 was implemented with recursion”
1.5 Suppose a list is defined with the following assignment statement: numbers = [1, 2, 3, 4, 5, 6, 7] If we use the binary search algorithm we studied, how many comparisons (i.e. iterations of the while loop) will it take to find the number 5?
1.6 Suppose a list is defined with the following assignment statement: numbers = [33, 22, 55, 11, 44] Explain in 2-4 sentences in your own words how the Merge Sort (msort) function will sort the above list. Be sure to explain how it will merge and sort the groups for each step.
about python
In: Computer Science
PYTHON......
Working with lists, functions, and files Objective: Work with lists Work with lists in functions Work with files Assignment:
Part 1: Write a program to create a text file which contains a sequence of test scores. Ask for scores until the user enters an empty value. This will require you to have the scores until the user enters -1.
After the scores have been entered, ask the user to enter a file name. If the user doesn’t not enter a file name exit the program. If the user does enter a file name, write out the scores to the specified file. Then ask the user if they wish to create another data file. Continue on with this process until the user indicated they do not wish to create another data file or they do not enter a file name.
Part 2: Write a program that will ask the user for a data file. Use one of the data files created from part 1. Each line of the file must contain a single value. Fill a list with the values from the file.
Once the list has been filled with values, the program should display, with appropriate labels, the largest value from the list, the smallest value from the list, and the average of the list (with 2 places after the decimal point). Then ask the user for a lower limit and an upper limit. Display all the values from the list that fall within that range.
The code to find the largest, smallest, and average must be done in value-returning functions. Do not use any built-in functions to find these values, write loops to implement these functions. The code to print out a range of scores must be done a function. The arguments for that function MUST be a list, a lower limit and an upper limit. The “matching values” function can print out values. For the rest of the program, only the main function will ask questions or print output.
In: Computer Science
In: Computer Science