Questions
Write a program in JAVA "When a share of common stock of some company is sold,...

Write a program in JAVA

"When a share of common stock of some company is sold, the capital gain(or,sometimes, loss) is the difference between the share’s selling price and the price originally paid to buy it. This rule is easy to understand for a single share, but if we sell multiple shares of stock bought over a long period of time, then we must identify the shares actually being sold. A standard accounting principle for identifying which shares of a stock were sold in such a case is to use a FIFOprotocol—the shares sold are the ones that have been held the longest (indeed,this is the default method built into several personal finance software packages).For example, suppose we buy 100 shares at $20 each on day 1, 20 shares at $24on day 2, 200 shares at $36 on day 3, and then sell 150 shares on day 4 at $30each. Then applying the FIFO protocol means that of the 150 shares sold, 100were bought on day 1, 20 were bought on day 2, and 30 were bought on day3. The capital gain in this case would therefore be 100·10+20·6+30·(−6),or $940. Write a program that takes as input a sequence of transactions of the form “buy x share(s) at $y each” or “sell x share(s) at $y each,” assuming that the transactions occur on consecutive days and the values x and y are integers. Given this input sequence, the output should be the total capital gain(or loss) for the entire sequence, using the FIFO protocol to identify shares."

Your program should prompt the user to input a single string that represents a sequence of transactions. Use semicolon (‘;’) to separate the transactions in your input string. For example, your program should support the following input string:

“buy 100 share(s) at $20 each;buy 20 share(s) at $24 each;buy 200 share(s) at $36 each;sell 150 share(s) at $30 each;buy 50 share(s) at $25 each;sell 200 share(s) at $35 each;”

The output of your program should be the total capital gain (or loss) for the entire sequence, using the FIFO protocol as explained in P-6.36. For instance, the output for the example input should be: 1070

• Consider using built-in Java classes, e.g., classes that implement the interface java.util.Queue

In: Computer Science

2) At the start of the new year, Adriana finds out that the price of her...

2) At the start of the new year, Adriana finds out that the price of her economics textbook increased from $100 to $120, She along with her classmates plans on purchasing the textbook, but falls from 10 students to 9 students. At the same time, the minimum wage increased from $11.50 to $12.00. What is Adriana’s income elasticity?

3) Ernesto is looking to purchase a new vehicle as his income has increased from $2,000 per month to $3,000 per month, so his purchase increases from 0 to 1 vehicle. He see’s a new Mercedes Benz that decreased its price from $45,000 to $42,000. What is Ernesto’s income elasticity of demand for a Mercedes Benz vehicle?

4) Cris, a dedicated employee at Google just found out that he will be recognized for the employee of the year award, plus an additional pay increase of 10%. He along with several top employees from other states rush to purchase Porsche 911 4S vehicles resulting in a 7% increase in the quantity demanded. What is Cris’ income elasticity of demand for a Porsche 911 4S?

5) Jerry, an addict of Jamba Juice finds out about his 3% increase in pay, so he plans on increasing his Jamba Juice consumption by 5% not to mention Jamba Juice’s 1% price decrease. However, he plans to decrease his consumption of Tropical Smoothie by 2%. What is Jerry’s cross-price elasticity of demand for a Tropical Smooth with respect to the price of Jamba Juice?

6) Matthew is an addicted coffee drinker and proud patron of Starbucks, so he keeps an eye out on the prices of coffee. He finds out that Starbucks increases its price of a grande frappuccino from $3.50 to $4.00, so he expects many patrons to consume less grande lattes from 2 to 1 per week, and to find an alternative. He lives by a Coffee Bean and Tea Leaf café and his opportunity for a grande frappucino is a medium ice blended. He plans to consume more medium ice blended drinks increasing his quantity demanded from 1 to 5 per week. What is the cross price elasticity of demand for a medium ice blended drink with respect to a grande frappuccino’s price?

In: Economics

In the labor market the wage rate requested by workers will generally depend on workers’ expected...

In the labor market the wage rate requested by workers will generally depend on workers’ expected price Pe which is to prevail in the future, the current unemployment rate u, and a variable z that represents the unemployment benefits package. This defines the wage-setting relationship: W = PeF(u,z). At the same time, firms define the price-setting relationship: P = (1+m)W, where m is the markup of goods prices over wage rate.

(1) Suppose we know the functional form F(u,z) = z(1-u) and z = 1; and the markup m = 5%. Calculate the natural rate of unemployment, i.e., the unemployment rate when the economy is at the medium-run equilibrium.

(2) Assume everything given in part (1) but now z = 1.05. That is to say, the government increases the unemployment benefits package. Calculate the natural rate of unemployment again.

(3) Assume everything given in part (1) but with a new markup m = 10%. Calculate the natural rate of unemployment again.

(4) Suppose that the unemployment benefits z = 1. Also assume the production function is Y = N and we know the definition of unemployment gives u = (L- N)/L, where N is the number of employed workers and L is the labor force. Also assume that the markup m = 10%, labor force L = 880 and the expected price Pe = 1. Derive the aggregate supply (AS) relationship, i.e. a relationship between the current price P and the output Y. How will current price P change if the output Y increases? Explain why in economic words.

(5) Place price P on the vertical axes and output Y on the horizontal axes. Draw the aggregate supply (AS) curve. Explain and illustrate on the graph what will happen to the AS curve if the expected price Pe increases.

(6) Suppose the goods market in a closed economy can be represented by the following equations:

C = 100 + .5YD
I = 200 + .1Y – 800i T = 200
G = 200
YD = Y – T

Also suppose in the money market of this closed economy, the real money demand is (Md/P) = Y – 3,000i; and the nominal money supply is set by the FED at Ms = $500.

Derive the aggregate demand (AD) equation for this economy.

(7) Put AD and AS curve together to solve for the equilibrium output and price for this economy. Is this economy at the medium-run equilibrium?

In: Economics

1. There are two mutual fund managers. Manager 1 earned 15% in the past year, whereas...

1. There are two mutual fund managers. Manager 1 earned 15% in the past year, whereas manager 2 earned 10% in the past year. The beta of the first manager is 1.1, whereas the beta for the second manager is 0.8. Assume CAPM is the correct model. Which manager is a better stock selector (i.e. who performed better on a risk-adjusted basis)?

2. There are two mutual fund managers. Manager 1 earned 18% in the past year, whereas manager 2 earned 7% in the past year. The beta of the first manager is 2.1, whereas the beta for the second manager is 0.9. Assume the expected market risk premium is 12% and the risk-free rate is 5%. Assume CAPM is the correct model. Which manager is a better stock selector (i.e. who performed better on a risk-adjusted basis)?

3. A discount bond has a quoted yield to maturity of 10% and a par amount of $1000. What do you know about a) the price of the bond, and b) the coupon?

In: Finance

The marketing department of Jessi Corporation has submitted the following sales forecast for the upcoming fiscal...

The marketing department of Jessi Corporation has submitted the following sales forecast for the upcoming fiscal year: 1st Quarter 2nd Quarter 3rd Quarter 4th Quarter Budgeted sales (units) 9,300 11,300 13,300 12,300 The selling price of the company’s product is $33 per unit. Management expects to collect 55% of sales in the quarter in which the sales are made and 40% in the following quarter; 5% of sales are expected to be uncollectible. The beginning balance of accounts receivable, all of which are expected to be collected in the first quarter, is $93,500. The company expects to start the first quarter with 2,650 units in finished goods inventory. Management desires an ending finished goods inventory in each quarter equal to 15% of the next quarter’s budgeted sales. The desired ending finished goods inventory for the fourth quarter is 2,900 units. Required: 1-a. Prepare the company's sales budget. 1-b. Prepare the schedule of expected cash collections. 2. Prepare the company's production budget for the upcoming fiscal year.

In: Accounting

1. In terms of efficiency, what justifies subsidies for R&D in renewable energy? What justifies subsidies...

1. In terms of efficiency, what justifies subsidies for R&D in renewable energy? What justifies subsidies for electricity generation from renewable energy? (Response can be in list form here.)

2. What is the first-best policy instrument to mitigate climate change in the energy industry? How does the performance of subsidies for renewable energy compare with the first-best policy? (Response can be in list form here.)

3. How does emissions trading (cap-and-trade) work and what is the benefit of its approach?

4. Explain the reason for revenue decoupling and how it works. (Hint: Explain how revenue decoupling is a deviation from traditional rate-of-return/cost-of-service regulation).

5. Deregulation of electricity markets leads to different electricity prices on different days and at different times of a day. Using a supply-demand diagram, explain why electricity prices tend to be volatile under such pricing. (Hint: how would you characterize the price elasticity of supply and demand at peak periods?)

In: Economics

Problem 10-3A Straight-Line: Amortization of bond premium LO P1, P3 Hillside issues $3,000,000 of 6%, 15-year...

Problem 10-3A Straight-Line: Amortization of bond premium LO P1, P3 Hillside issues $3,000,000 of 6%, 15-year bonds dated January 1, 2018, that pay interest semiannually on June 30 and December 31. The bonds are issued at a price of $3,671,990. Required: 1. Prepare the January 1, 2018, journal entry to record the bonds’ issuance. 2(a) For each semiannual period, complete the table below to calculate the cash payment. 2(b) For each semiannual period, complete the table below to calculate the straight-line premium amortization. 2(c) For each semiannual period, complete the table below to calculate the bond interest expense. 3. Complete the below table to calculate the total bond interest expense to be recognized over the bonds' life. 4. Prepare the first two years of an amortization table using the straight-line method 5. Prepare the journal entries to record the first two interest payments.

In: Accounting

Problem 10-2A Straight-Line: Amortization of bond discount LO P1, P2 Hillside issues $1,900,000 of 5%, 15-year...

Problem 10-2A Straight-Line: Amortization of bond discount LO P1, P2 Hillside issues $1,900,000 of 5%, 15-year bonds dated January 1, 2018, that pay interest semiannually on June 30 and December 31. The bonds are issued at a price of $1,641,812. Required: 1. Prepare the January 1, 2018, journal entry to record the bonds’ issuance. 2(a) For each semiannual period, complete the table below to calculate the cash payment. 2(b) For each semiannual period, complete the table below to calculate the straight-line discount amortization. 2(c) For each semiannual period, complete the table below to calculate the bond interest expense. 3. Complete the below table to calculate the total bond interest expense to be recognized over the bonds' life. 4. Prepare the first two years of an amortization table using the straight-line method. 5. Prepare the journal entries to record the first two interest payments

In: Accounting

1- The government of England has decided to issue a bond which has face value of...

1- The government of England has decided to issue a bond which has face value of 1,200$ and maturity of three years. The government has announced that it won’t make any coupon payments to the lenders. If the yield to maturity is 5.8%, how much the investors should pay for the bond?

2- You are planning to set up a deposit account and invest 500$ every month for the next six months. According to the strict policies of your bank, your deposit account will be compounded semi-annually. If the relevant interest rate is 7% and if your first deposit payment occurs today, what will be the value of your account at the end of the investment period?

3- Btech corp. has announced that it will distribute 2$ dividend two years from now. The company also plans to distribute a 5$ dividend after three years of it’s first dividend payment. If the required rate of return is 13% and if the predicted selling price in year 5 is 30$, how much the stock should worth right now?

In: Finance

Arlington, Texas wants to build a new recreation center. The estimated cost of construction cost us...

Arlington, Texas wants to build a new recreation center. The estimated cost of construction cost us $14 million with annual staffing and maintenance costs of $520,000 per year over the twenty-year life of the center. At the end of the life of the center, Arlington expects to sell the land for $5 million, though that figure might be as low as $1 million and as high $ 9 million. City staff estimate first year benefits to be $2.1 million (accruing at the end of the first year). Staff expect annual benefits to grow in real terms at 4 percent, though this could be as low as 1 percent and as high as 6 percent. They assume that the real discount rate for use in Arlington should be 7 percent, thought it might be a percentage point higher or lower

a) What is the present value of net benefits for the recreation project using staff predictions?

b) What is the sensivity of the present value of net benefits to alternative predictions about land price, growth rate of annual benefits and the real discount rate.

In: Finance