Question #4
DO NOT USE ANY NON-STANDARD LIBRARY. o All the required libraries have already been included. O DO NOT INCLUDE ANY OTHER LIBRARY INTO THE CODE. o DO NOT ALTER THE NAMES OF THE C FILES PROVIDED. o DO NOT ALTER THE NAMES AND PROTOTYPES OF THE FUNCTIONS. DO NOT ALTER THE CODE, ONLY ADD WHATS NEEDED TO MAKE IT WORK.
This is the code:
#include <stdio.h>
/*
* This function counts and returns the number of adjacent Up and
Downs in an array of integers.
* In other words, you should count and return the number of
changing directions in the sequence.
* This means, for instance, if the sequence is entirely ascending,
or entirely descending, it should return 0.
* Examples:
* For the sequence {1,2,3,5} starting from 1, you say "Up, Up, Up",
so it returns 0, (no changing direction)
* For the sequence {0,2,1,7} starting from 0, you say "Up, Down,
Up", so it returns 2, (two times of changing directions or two
adjacent up/downs)
* For the sequence {2,3,1,4,5,2,1} starting from 2, you say "Up,
Down, Up, Up, Down, Down", so it returns 3, (three adjacent
up/downs)
* For the sequence {4,3,2,1} starting from 4, you say "Down, Down,
Down", so it returns 0, (no changing direction)
*/
int adjacentUpDowns(int a[], int size);
int main(void) {
int a[] = {1,2,3,5};
int b[] = {0,2,1,7};
int c[] = {2,3,1,4,5,2,1};
int d[] = {4,3,2,1};
printf("%d\n", adjacentUpDowns(a,4));
//Expected output is 0
printf("%d\n", adjacentUpDowns(b,4));
//Expected output is 2
printf("%d\n", adjacentUpDowns(c,8));
//Expected output is 3
printf("%d\n", adjacentUpDowns(d,4));
//Expected output is 0
}
int adjacentUpDowns(int a[], int size) {
// Complete the code of the function
}
In: Computer Science
|
You are holding your physics book against the wall by pressing on it with a force directed straight into the wall. (a) You are pressing hard enough so that the book doesn’t move. Drawing a free-body diagram for the book and identifying all the forces that are acting on the book. Assuming the force from the hand is directly to the right,
7. What relations are there among the forces in your diagram? That is, which forces or sums of forces have to be equal? How do you know? (this question will not be auto-graded, answer fully) |
8. You begin to get tired and the book begins to slide down. The book begins to slide down, and you respond so it slides down at a constant velocity. How do each of the forces you have identified change from their magnitudes in part (a)? Explain how you know. (this question will not be auto-graded, answer fully)
9. If the book has a mass of 2 kg, the coefficient of friction between the sliding book and the wall is 0.4, how hard do you have to press on the book if it is sliding down with a speed of 2 cm/s? D2M
10. BCD on 9
In: Physics
Consider the S&P/ASX 200 option contracts that expire on 17th September 2020, with a strike price of 6050. On 24th July 2020, the S&P/ASX 200 index was priced at 6019.8. The annual standard deviation of S&P/ASX 200 stocks is 26%. The risk-free rate is 2.25% with annual compounding. Assume no dividends are paid on any of the underlying securities in the index.
Using a three-step binomial tree model, construct a Theotrical price for European calls and puts please show all working out
In: Accounting
Suppose that the manager did place the hedge in May. We are now on October 15th, 2020 and the plant has just taken delivery of the corn whose price she hedged. She is now managing price risk for the next corn intake, for mid-February, and is considering using a futures hedge to lock in a price. Which maturity should she use?
a. December 2020 (expires Dec. 15)
b. March 2021 (expires Mar. 15, 2021)
c. May 2021 (expires May, 2021)
d. Not enough information
In: Finance
Sheffield Co. had sales revenue of $550,900 in 2020. Other items
recorded during the year were:
| Cost of goods sold | $325,700 | |
| Salaries and wages expense | 127,600 | |
| Income tax expense | 26,050 | |
| Increase in value of company reputation | 17,540 | |
| Other operating expenses | 12,050 | |
| Unrealized gain on value of patents | 22,240 |
Prepare a single-step income statement for Sheffield for 2020.
Sheffield has 100,700 shares of stock outstanding.
(Round earnings per share to 2 decimal places, e.g.
1.48.)
In: Accounting
A company purchased a piece of equipment for $40,000 on January 1, 2018. At that time the company estimated the equipment would have a 6-year useful life and no salvage value. The company used straight-line depreciation based on this information used through 2019. On December 31, 2020, the company determined the equipment instead has a 9-year useful life, with no salvage value. The company's tax rate has been 20% since 2015. What is the necessary adjustment to beginning retained earnings in 2020 for this change?
In: Accounting
A machine cost $1,128,000 on April 1, 2020. Its estimated
salvage value is $136,000 and its expected life is 4
years.
Calculate the depreciation expense by straight-line for 2020. (Round answer to 0 decimal places, e.g. 5,275.)
| Depreciation expense | $ |
Calculate the depreciation expense by double-declining balance for 2021. (Round answer to 0 decimal places, e.g. 5,275.)
| Depreciation expense | $ |
Calculate the depreciation expense by sum-of-the-years'-digits for 2021. (Round answer to 0 decimal places, e.g. 5,275.)
| Depreciation expense | $ |
In: Accounting
Citibank issued bonds few years ago. Investor John sells
$100 par of the bonds mid-accrual period settlement on
8/19/2020.
Givens:
Coupon = 6%
Coupon Payment Frequency = Semi-annual
Interest Payment Dates are March 31 and Sept 30th
Maturity Date September 30th, 2023
Day Count Convention = 30/360
Yield-to-Maturity 4%
What are the Full (Dirty) proceeds of the sale of this
bond closest to on August 19th, 2020?
(bond does not accrue interest on 8/19)
In: Finance
|
On January 1, 2019 Lindsay Inc. provided consulting services( NOT CASH ) to Hamler Corp. in return for a 2 year, zero interest note. Hamler Corp will pay Lindsay Inc. $20,000 when the note matures on December 31, 2020. The interest rate on similar notes is 6%. Complete the following amortization table related to Lindsay’s Notes Receivable. |
||||||
|
Date |
Cash Received |
Interest Revenue |
Disc/Prem Amortized |
Carrying Amount |
||
|
1-Jan |
||||||
Please prepare the necessary journal entries for Lindsay Inc. in 2019 and 2020.
In: Accounting
A4. The data below shows the weekly cases of Covid-19 for Ghana
as at 19th June 2020 since the
first case was recorded on 2nd March 2020(Source: WHO).
2571 1473 1582 817 956 2439 1017 920 513 263 174 72 121 11
It is being argued on public airwaves that, the average weekly
cases in Ghana is more than 500.
By testing the claim of what is being said on airwaves using the
Sign Test, compute the
significance probability of the test correct to 4 decimal
places.
In: Statistics and Probability