"Write a function named "firstLast2" that takes as input a vector of integers. The function should...

"Write a function named "firstLast2" that takes as input a vector of integers. The function should return true if the vector starts and ends with the digit 2. Otherwise, it should return false. Test your function with vectors of different length and with the digit 2 at the beginning of the vector, end of the vector, middle of the vector, and missing from the vector."

Additional Requirements:

>Must use a loop allowing the user to continue until he/she quits.

>Read the full name, middle (if there is any) and last name separately.

>Must work even if there is no middle name.

In: Computer Science

On January 2, 2015, the S. H. Park Company (Park) installed a new $84,000 special molding...

On January 2, 2015, the S. H. Park Company (Park) installed a new $84,000 special molding machine for producing a new product. The product and the machine have an expected life of three years. The machines expected disposal value (amount machine can be sold for) at the end of three years is zero. S. H. Park Company paid cash when the equipment was delivered. Park paid for this machinery via bank transfer. On January 3, 2015, Kimiyo Lee, a salesperson for BT Machine and Tool (BT), tells Park: “I wish I had known earlier of your purchase plans. I can supply you with a technically superior machine for $99,000. Lee indicated the machine just purchased can be sold for $16,000. Lee guaranteed that there machine will save S. H. Park $35,000 per year in cash operating costs. This machine will have no disposal value at the end of three years.” Assume all costs are cost of sales. Park examines some technical data. Park is confident of Lee’s claims. However, Park contends, “I’m locked in now. My alternatives are clear: (a) disposal will result in a loss, (b) keeping and using the ‘old’ equipment avoids such a loss. I have brains enough to avoid a loss when my other alternative is recognizing a loss. We’ve got to use that equipment until we get our money out of it.” The annual operating costs of the old machine are $60,000 all paid in cash. This does not include depreciation. The new machine operating costs will be $25,000 which will be paid in cash. Sales, all in cash, are projected to be $850,000 per year. Annual cash expenses related to sales are $350,000 for material, $250,000 for labor and $150,000 for other operating expenses regardless of this decision. Assume that the equipment in question is the company’s only fixed asset. Ignore income taxes and the time value of money. Any cash payments for the machines occurred in 2015 coinciding with the purchase of the equipment. Should Park dispose of the “old-old” machine (stay the course) or should Park acquire new machine’s (New-New) from Lee? Using the template, prepare income statements as they would appear in each of the next three years under both alternatives. Assume straight-line depreciation over a three year period. What is the cumulative increase or decrease in net income for the three years for each alternative? Prepare statements of cash receipts and disbursements as they would appear in each of the next three years under both alternatives. Assume straight-line depreciation over a three year period. What is the total cumulative increase or decrease in cash for the three years for each alternative? If you were the sales person (Kimiyo Lee), how would respond to Mr. Park so as to get him to purchase your product? Using the provided information, if possible, prepare an alternative analysis which provides a similar result. Regardless of the financial analysis, what factors which effect or influence the decision to replace the equipment or stay with old (new) machine

In: Accounting

prove A(A+B) = A using truth table

prove A(A+B) = A using truth table

In: Computer Science

do you think the way classical economics models individual decision making (through utility maximization) is flawed...

do you think the way classical economics models individual decision making (through utility maximization) is flawed and should be altered? If so, how?

In: Economics

In reaching her destination, a backpacker walks with an average velocity of 1.05 m/s, due west....

In reaching her destination, a backpacker walks with an average velocity of 1.05 m/s, due west. This average velocity results, because she hikes for 5.66 km with an average velocity of 2.54 m/s due west, turns around, and hikes with an average velocity of 0.403 m/s due east. How far east did she walk (in kilometers)?

In: Physics

On January 1, 2018, the general ledger of Freedom Fireworks includes the following account balances:   Accounts...

On January 1, 2018, the general ledger of Freedom Fireworks includes the following account balances:

  Accounts Debit Credit
  Cash $ 13,200
  Accounts Receivable 38,000
  Inventory 154,000
  Land 87,300
  Buildings 140,000
  Allowance for Uncollectible Accounts $ 3,800
  Accumulated Depreciation 11,600
  Accounts Payable 39,700
  Common Stock 220,000
  Retained Earnings 157,400
       Totals $ 432,500 $ 432,500

During January 2018, the following transactions occur:

January 1

Borrow $120,000 from Captive Credit Corporation. The installment note bears interest at 5% annually and matures in 5 years. Payments of $2,180 are required at the end of each month for 60 months.

January 4 Receive $33,000 from customers on accounts receivable.
January 10 Pay cash on accounts payable, $31,000.
January 15 Pay cash for salaries, $30,900.
January 30

Firework sales for the month total $206,000. Sales include $67,000 for cash and $139,000 on account. The cost of the units sold is $122,500.

January 31

Pay the first monthly installment of $2,180 related to the $120,000 borrowed on January 1. Round your interest calculation to the nearest dollar.


The following information is available on January 31, 2018.

  1. Depreciation on the building for the month of January is calculated using the straight-line method. At the time the building was purchased, the company estimated a service life of 10 years and a residual value of $26,000.
  2. The company estimates future uncollectible accounts. The company determines $5,000 of accounts receivable on January 31 are past due, and 50% of these accounts are estimated to be uncollectible. The remaining accounts receivable on January 31 are not past due, and 2% of these accounts are estimated to be uncollectible. (Hint: Use the January 31 accounts receivable ending balance shown in the general ledger to start your calculations.) Record the estimated bad debt expense.
  3. Unpaid salaries at the end of January are $28,100. (Recognize that salaries are owed, but have not been paid yet.)
  4. Accrue income taxes at the end of January are $10,000. (Recognize that income taxes are due, but have not been paid yet.)

1.

Record each of the transactions listed above in the 'General Journal' tab (these are shown as items 1 - 7) assuming a FIFO perpetual inventory system. The transaction on January 30 requires two entries: one to record sales revenue and one to record cost of goods sold. Review the 'General Ledger' and the 'Trial Balance' tabs to see the effect of the transactions on the account balances.

2.

Record adjusting entries on January 31. in the 'General Journal' tab (these are shown as items 8-11).
3. Review the adjusted 'Trial Balance' as of January 31, 2018, in the 'Trial Balance' tab.

4.

Prepare a multiple-step income statement for the period ended January 31, 2018, in the 'Income Statement' tab.
5. Prepare a classified balance sheet as of January 31, 2018, in the 'Balance Sheet' tab.

6.

Record the closing entries in the 'General Journal' tab (these are shown as items 12 and 13).

In: Accounting

Based on the Incorporation Doctrine, formulate a focus question that offers either a broad or specific...

Based on the Incorporation Doctrine, formulate a focus question that offers either a broad or specific analysis of the Incorporation Doctrine.

Once you have constructed your question, you should submit a short analysis based answer.

You will construct the question and then offer an answer. 300 words minimum please.

In: Economics

Suppose that (Yi, Xi) satisfy the assumptions we made in the regression analysis. A random sample...

Suppose that (Yi, Xi) satisfy the assumptions we made in the regression analysis. A random sample of size n = 250 is drawn and yields

Yi =5.4 + 3.2×Xi, R2 =0.26, SER=6.2 (3.1) (1.5)

(i) TestH0 :β1 =0vs. H1 :β1 ̸=0atthe5%level.

(ii) Construct a 95% confidence interval for β1.

(iii) Suppose you learned that Yi and Xi were independent. Would you be surprised? Explain.

(iv) Suppose that Yi and Xi are independent, and many samples of size n = 250 are drawn, regressions estimated and the parts (a) and (b) answered. In what fraction of samples would the value β1 = 0 be included in the confidence interval from the second part.

In: Economics

Selected year-end financial statements of Cabot Corporation follow. (All sales were on credit; selected balance sheet...

Selected year-end financial statements of Cabot Corporation follow. (All sales were on credit; selected balance sheet amounts at December 31, 2016, were inventory, $55,900; total assets, $249,400; common stock, $87,000; and retained earnings, $40,778.) CABOT CORPORATION Income Statement For Year Ended December 31, 2017 Sales $ 453,600 Cost of goods sold 297,750 Gross profit 155,850 Operating expenses 99,000 Interest expense 4,900 Income before taxes 51,950 Income taxes 20,928 Net income $ 31,022 CABOT CORPORATION Balance Sheet December 31, 2017 Assets Liabilities and Equity Cash $ 14,000 Accounts payable $ 17,500 Short-term investments 9,000 Accrued wages payable 3,600 Accounts receivable, net 34,000 Income taxes payable 4,400 Notes receivable (trade)* 5,500 Merchandise inventory 40,150 Long-term note payable, secured by mortgage on plant assets 70,400 Prepaid expenses 2,750 Common stock 87,000 Plant assets, net 149,300 Retained earnings 71,800 Total assets $ 254,700 Total liabilities and equity $ 254,700 * These are short-term notes receivable arising from customer (trade) sales. Required: Compute the following: (1) current ratio, (2) acid-test ratio, (3) days' sales uncollected, (4) inventory turnover, (5) days' sales in inventory, (6) debt-to-equity ratio, (7) times interest earned, (8) profit margin ratio, (9) total asset turnover, (10) return on total assets, and (11) return on common stockholders' equity. (Do not round intermediate calculations.)

In: Accounting

Zero Turbulence Airline provides air transportation services between Los Angeles, California; and Kona, Hawaii. A single...

Zero Turbulence Airline provides air transportation services between Los Angeles, California; and Kona, Hawaii. A single Los Angeles to Kona round-trip flight has the following operating statistics:

Fuel $12,878
Flight crew salaries 9,864
Airplane depreciation 4,658
Variable cost per passenger—business class 65
Variable cost per passenger—economy class 50
Round-trip ticket price—business class 555
Round-trip ticket price—economy class 300

It is assumed that the fuel, crew salaries, and airplane depreciation are fixed, regardless of the number of seats sold for the round-trip flight. If required round the answers to nearest whole number.

a. Compute the break-even number of seats sold on a single round-trip flight for the overall product, E. Assume that the overall product is 10% business class and 90% economy class seats.

Total number of seats at break-even seats

b. How many business class and economy class seats would be sold at the break-even point?

Business class seats at break-even seats
Economy class seats at break-even seats

In: Accounting

Kp has the value 1.00x10^-5 for the equilibrium CO2(g) + H2(g) <--> CO(g) + H2O(g) at...

Kp has the value 1.00x10^-5 for the equilibrium

CO2(g) + H2(g) <--> CO(g) + H2O(g)

at 25oC and ΔSo is -41.9 J/K (ΔHo and ΔSo do not change much with temperature). One mole of CO, 2 moles of H2, and 3 moles of CO2 are introduced into a 5-liter flask at 25oC. Calculate

(a) ΔGo at 25oC,

(b) the equilibrium pressure,

(c) the moles of each species present at equilibrium,

(d) Kp at 100 0C. The mixture obeys the ideal equation of state.

In: Chemistry

Write a MARIE program that asks the user for a beginning and an ending address of...

Write a MARIE program that asks the user for a beginning and an ending address of an array in the memory and checks whether the sequence of integers in between these memory locations is a palindrome. Output 1 on the screen if you conclude it is a palindrome. Add comments to your program.

In: Computer Science

Calculate the energy gap in J, kJ/mol, eV, and wavenumber (cm-1) between the level n =...

Calculate the energy gap in J, kJ/mol, eV, and wavenumber (cm-1) between the level n = 5 and n = 1 of an electron confined to a microscopic 1-D box of length 2.00 Angstroms.


  1- J
  2- kJ/mol
  3 -eV
  4- cm-1

In: Chemistry

2. a. Choose all of the following that apply to DynamoDB: (a) DynamoDB is part of...

2.

a. Choose all of the following that apply to DynamoDB:

(a) DynamoDB is part of RDS

(b) Is stored in 3 different locations

(c) Does not support joins, foreign keys and complex queries

(d) Supports Local and Global secondary indexes

(e) Users can manage DynamoDB in the backend (add CPU, memory, etc)

(f) Utilizes partition key to spread data across partitions for scalability

b. Which of the following standard is used by MongoDB to store documents internally?

(a) BSON

(b) JSON

(c) Extended JSON

(d) SQL

In: Computer Science

I asked this question before, but I'm wondering if there are any other ways to do...

I asked this question before, but I'm wondering if there are any other ways to do this problem. My exam will be similar to this, so I'm looking for more examples to study with. Thank you!

For this Java program, you will write two classes: GradeCalculator and GradeCalculatorDriver.

In the GradeCalculator class, compute the final average and letter grade for a particular student.

The final average is calculated according to the following rules:

1) There are ten exams scored out of 100 points

2) The lowest exam score is not included in the calculation of the final average

3) The highest exam score is not included in the calculation of the final average

4) An average of 91-100 is an A

5) An average of 81-90 is a B

6) An average of 71-80 is a C

7) An average of 61-70 is a D

8) An average of 0-60 is an E

The GradeCalculator class must include the following methods:

1) A method to compute and return the highest score

2) A method to compute and return the lowest score

3) A method to compute the sum of all the scores

4) A method to compute the final average

5) A method to determine the letter grade

In the GradeCalculatorDriver class, include a main method that asks the user for the student’s name and their ten exam grades, reads the grades, calculates the letter grade and prints it. This process should be repeated until the user enters N.

For example, a run of the program might look something like this:

Welcome to Score Calculator

Want to compute a final average? Y

Please enter the student’s name: Sara Smith

Please enter test scores all on one line separated by one or more spaces.

The final score for Sara Smith is 100.

The letter grade for Sara Smith is A.

Want to compute another final average? N

In: Computer Science