A column in your data is missing a value in one row. Which command fills this missing data point with the value before it?
Select an answer:
df.fillna(method='bfill')
df.fillna(0)
df.fillna(method='linear')
df.fillna(method='ffill')
In: Computer Science
Do you know of any cases, other than what was covered in the lecture, in which reward systems are inconsistent with the desired behavior? What is the impact of this misalignment?
In: Operations Management
Which of the following is a motivation for passing functions around in Java?
Select one:
a. Compiled code with anonymous functions is smaller in size than with explicit functions.
(INCORRECT)b. Passing functions as objects around and applying them is significantly less complex than writing the logic for those algorithms directly.
c. It is the only way for the class to allow clients to access data that is otherwise private.
d. It allows clients to provide an algorithm without ownership of the data it operates on.
If we define a class as follows: public class Foo<T extends Bar> { }
Which of the following is a fact that we know about T? Select all that apply.
Select one or more:
a. Foo must define the same methods as Bar.
(INCORRECT)b. T must be a direct subclass of Bar.
c. T objects have access to all of the public methods defined in Bar.
d. T must be Bar or a class that inherits from Bar, directly or indirectly.
Which of the following is an advantage to using an interface as opposed to an abstract class?
Select one:
a. An interface can be the type for a variable declaration.
(INCORRECT)b. A class can inherit a default implementation for a method from an interface.
c. A class can implement multiple interfaces.
d. Interfaces can hold instance variables.
In: Computer Science
Write a program that contains a main method and another method named userName. The main method should prompt the user to enter a full name. The userName method takes the full name as an argument and prints the name in reverse order and returns the number of characters in the name. See Sample Output (input shown in blue).
Sample Output
Please enter your FULL name
Billy Joe McCallister
Here is the name Billy Joe McCallister in reverse:
retsillaCcM eoJ ylliB
Billy Joe McCallister consists of 21 characters
In: Computer Science
Language: C and comment code please
PThreads
The goal of this homework is to show an understanding of pthreads and C.
Assignment:
Write a C program to use the bitwise operations with each bitwise operation contained within its own thread. Each thread should take 1 parameter and will only modify global values.
First, create global integers x and y, then, in the main function you will read in values for x and y from the user and then create the threads.
Each thread will use the parameter passed to them to determine which operation to run:
Thread 0: |
Thread 1: &
Thread 2: ~
Thread 3: ^
Thread 4: <<
Thread 5: >>
(You should probably use a switch statement for this)
Once a thread has computed its value (x OP y, where OP is one of the above operations, or, in the case of ~ you will just do ~x and ~y), it will then set x = y and y = (x OP y).
You will need to use a mutex to keep x and y safe when you are reading and writing this data.
In: Computer Science
In C++, please. Thank you!
Perhaps you remember the popular TV show, Deal or No Deal, with Howie Mandel as the host, that ran several years ago. In honor of the show returning in its original form (and renewed for a fifth season in 2019!) this lab is called Stack or No Stack.
As we studied in Chapter 1, imagine again a bag data structure into which we can insert and remove elements. This bag has two operations, defined as:
1 x | Insert an element (with value x) into the bag |
2 x | Take an element from the bag (the value x) |
This time the bag is somewhat mysterious. Given a sequence of inserts and removals, the bag may operate like a LIFO stack, or it may not.
Your program must guess whether or not the bag is operating as a stack given a series of operations and the corresponding return values.
Program Input
The input to your program will be a series of test cases in a file. Each test case begins with a line containing a single integer n (1 < n < 100). Following the operations defined in the above table, each of of the next n lines is either a type-1 command followed by an integer x (which inserts the value x) or a type-2 command followed by an integer x which means the command retrieves the value x. The value of x is always a positive integer not larger than 100. There will be no ambiguous test cases. In other words, you will be able to fully determine the output based on the input alone. The input is terminated by an end-of-file (EOF).
Your code may use anything in the standard C++ library -- including the STL stack container. This is, of course, optional.
Program Output
For each test case, output one of the following:
stack not stack
which will indicate whether or not the bag is determined to be operating as a stack, given the series of operations.
What to Submit
Please submit a .cpp file which contains your solution to the problem. Your program should take its input from a file. You will want to write some test driver code but you are not required to submit it as part of the assignment Do so only if it is convenient.
How to Earn Full Credit
Your code should compile, run, and pass all of the below test cases.
Code that does not compile or pass at least the below test cases will have points deducted. Your professor has held back a few extra cases that your program must also pass to receive full credit. Your program should output only 'stack' or 'not stack' once per line, with one line for each test case.
Sample Input
Create a file with the following lines and use it as input into your program. Please use at least these as your test cases before submitting your code in Canvas.
4 1 2 1 1 2 1 2 2 6 1 5 1 10 1 12 2 10 2 5 2 12 2 1 8 2 8
Sample Output
stack not stack stack
In: Computer Science
JAVASCRIPT:
- Please create an object (grade) with 10 names and 10
grades.
- Create a method (inputGrade) that can put a name and a grade to
the grade object.
- Create another method (showAlltheGrades) to show all the grade in
that object.
- Create the third method (MaxGrade) that can display the maximum
grade and the student name.
- Using “prompt” and inputGrade method input 10 student names and
their grades.
- Display all the grades and names by using showAlltheGrades
method.
NOTE: Make sure to use the push() method when adding elements to the arrays.
Prefer to use NotePad++ or Note Pad to type code. Please add on to the Pseudo Code and convert it into the javascript needed. Thank you
PLEASE USE THE REFERENCE JAVASCRIPT CODE BELOW!
[Reference JavaScript code]
<<html>
<body>
<script>
// Declare a class
class Student {
// initialize an object
constructor(grade, name) {
this.grade=grade;
this.name=name; }
//Declare a method
detail() {
document.writeln(this.grade + " " +this.name)
}//detail
}//class
var student1=new Student(1234, "John Brown");
var student2=new Student(2222, "Mary Smith");
student1.detail();//call a method
student2.detail();
</script>
</body>
</html>
[Find max pseudo code]
max← A[1]
while i < 10
if A[i] > max
max = A[i]
i ← i + 1
end while
In: Computer Science
Q4. Tiger Woods is known for having one of the fastest driving swings in Golf (among other things). In fact, his Tee-off ball speed was recorded to be 122 MPH.
Shoulder height = 1.5133
122 MPH = 54.54 m/s
In: Physics
A forensic audit firm has five audit jobs remaining at a point in time. The audits are labeled as jobs 1, 2, 3, 4 and 5. The respective audit times (in days) and the remaining days before the due date are given in the table below. Audit job Time required Due (at the end of) day
Audit job |
Time required |
Due (at the end of) day |
1 |
10 |
60 |
2 |
28 |
45 |
3 |
30 |
30 |
4 |
1 |
32 |
5 |
2 |
31 |
a) Determine the job sequence using each of these priority rules: (1) CR, (2) SPT and (3) EDD b) Determine the performance of each rule using (1) average flow time, (2) average days late, and 3) average work in progress c) Apply the appropriate method to determine the sequence which will minimize the total number of late jobs
In: Operations Management
how do I split this string in python??
testString="\0xdc\0x02\0xfe\0x7d\0xac"
I want it to be recognized as having a data length of 5 and for the first value to be 0xdc, second one to be 0x02 and so on...
In: Computer Science
4. The DuPont System allows us to relate the return on total
assets and the return on common equity to various measures of firm
characteristics. Consider a firm with a ROA of 0.04.
a. If you were analyzing a firm that had sales of $12500 and total
assets of $10000, how much in earnings were available for common
shareholders?
b.If the firm had common stockholders' equity of $3300, what would be the firm's ROE?
c. If we compare this firm to another similar firm in the industry we find that the comparison firm has an ROA and ROE of 0.05 and 0.191663, respectively. Given this information, calculate the comparison firm's ratio of total assets to common stock equity. How does this ratio differ from our firm?
d.Interpret the performance differences between these firms.
In: Finance
+1.00 millicoulomb is at position +1.00 m i . A point charge of -1.00 millicoulomb
is at the origin. What is the ratio of the magnitude of the electrostatic force due to the conducting sphere on the negative charge to the magnitude of the electric force due to
the positive point charge on the negative charge?
In: Physics
Where does the soft drink, Fanta, fit on the BCG portfolio management matrix in the Coca-Cola Company? Would it be considered a "star" with high relative market share and high market growth rate? A "cash cow" with high relative market share and low market growth rate? A "question mark" with low relative market share and high market growth rate? Or a "dog" with low relative market share and low market growth rate?
For reference:
Dogs. Dogs hold low market share compared to competitors and
operate in a slowly growing market. In general, they are not worth
investing in because they generate low or negative cash returns.
But this is not always the truth. Some dogs may be profitable for
long period of time, they may provide synergies for other brands or
SBUs or simple act as a defense to counter competitors moves.
Therefore, it is always important to perform deeper analysis of
each brand or SBU to make sure they are not worth investing in or
have to be divested.
Strategic choices: Retrenchment, divestiture, liquidation
Cash cows. Cash cows are the most profitable brands and should
be “milked” to provide as much cash as possible. The cash gained
from “cows” should be invested into stars to support their further
growth. According to growth-share matrix, corporates should not
invest into cash cows to induce growth but only to support them so
they can maintain their current market share. Again, this is not
always the truth. Cash cows are usually large corporations or SBUs
that are capable of innovating new products or processes, which may
become new stars. If there would be no support for cash cows, they
would not be capable of such innovations.
Strategic choices: Product development, diversification,
divestiture, retrenchment
Stars. Stars operate in high growth industries and maintain high
market share. Stars are both cash generators and cash users. They
are the primary units in which the company should invest its money,
because stars are expected to become cash cows and generate
positive cash flows. Yet, not all stars become cash flows. This is
especially true in rapidly changing industries, where new
innovative products can soon be outcompeted by new technological
advancements, so a star instead of becoming a cash cow, becomes a
dog.
Strategic choices: Vertical integration, horizontal integration,
market penetration, market development, product development
Question marks. Question marks are the brands that require much
closer consideration. They hold low market share in fast growing
markets consuming large amount of cash and incurring losses. It has
potential to gain market share and become a star, which would later
become cash cow. Question marks do not always succeed and even
after large amount of investments they struggle to gain market
share and eventually become dogs. Therefore, they require very
close consideration to decide if they are worth investing in or
not.
Strategic choices: Market penetration, market development, product
development, divestiture
In: Finance
A local car dealer is attempting to determine which premium will draw the most visitors to its showroom. An individual who visits the showroom and takes a test ride is given a premium with no obligation. The dealer chose four premiums and offered each for one week. The results are as follows:
Week |
Premium |
Total Given Out |
1 |
Four-foot metal stepladder |
430 |
2 |
$50 savings bond |
600 |
3 |
Dinner for four at a local steakhouse |
503 |
4 |
Six pink flamingos plus an outdoor thermometer |
707 |
3(a): Please identify the research question (one sentence).
Here are some examples of the research question:
How/why A is related to B?
Does A cause/equal/bigger/smaller/explain than B?
Whether A is equal/bigger/smaller than B?
3(b) Please generate the appropriate hypothesis
H0:
Ha:
3(c): Find the appropriate statistical test, compute the test statistics. Please give detailed calculation procedures.
3(d): Based on your computed test statistics, draw your conclusions
In: Math
Two independent companies, Bayer and Monsanto are in the chemical and pharmaceutical industries. Each owns a piece of laboratory equipment used in research and development of new products, but each would like the other firm’s equipment. They agree to exchange the equipment. An appraiser was hired, and from her report and the companies' records, the following information was obtained: Bayer’s Equipment Monsanto's Equipment Cost $826,000 $460,000 Accumulated depreciation $250,000 $100,000 Fair value based upon appraisal $720,000 $630,000 The exchange was made and based on the difference in appraised fair values. Monsanto paid $90,000 to Bayer.
1 a Prepare the entries on both companies' books assuming the exchange had no commercial substance.
1 b Also prepare the journal entries on both companies’ books assuming the exchange had commercial substance.
In: Accounting