Questions
Lab # 4 Multidimensional Arrays Please write in JAVA. Programming Exercise 8.5 (Algebra: add two matrices)...

Lab # 4 Multidimensional Arrays

Please write in JAVA.

Programming Exercise 8.5 (Algebra: add two matrices)

Write a method to add two matrices. The header of the method is as follows:

public static double[][] addMatrix(double[][] a, double[][] b

In order to be added, the two matrices must have the same dimensions and the same or compatible types of elements. Let c be the resulting matrix. Each element cij is aij + bij. For example, for two 3 * 3 matrices a and b, c is

Write a test program that prompts the user to enter two 3 * 3 matrices and displays their sum. Here is a sample run

Example run:

Enter matrix1: 1 2 3 4 5 6 7 8 9 (enter)

Enter martix2: 0 2 4 1 4.5 2.2 1.1 4.3 5.2 (enter)

The matrices are added as follows:

1.0 2.0 3.0              0.0 2.0 4.0            1.0 4.0 7.0

4.0 5.0 6.0        +    1.0 4.5 2.2     =      5.0 9.5 8.2

7.0 8.0 9.0              1.1 4.3 5.2           8.1 12.3 14.2

Programming Exercise 8.6 (Algebra: multiply two matrices)

Write a method to multiply two matrices. The header of the method is:

public static double[][] multiplyMatrix(double[][] a, double[][] b)

To multiply matrix a by matrix b, the number of columns in a must be the same as the number of rows in b, and the two matrices must have elements of the same or compatible types. Let c be the result of the multiplication. Assume the column size of matrix a is n. Each element cij is ai1 * b1j + ai2 * b2j + c + ain * bnj. For example, for two 3 * 3 matrices a and b, c is

where cij = ai1 * b1j + ai2 * b2j + ai3 * b3j. Write a test program that prompts the user to enter two 3 * 3 matrices and displays their product. Here is a sample run:

Example run:

Enter matrix1: 1 2 3 4 5 6 7 8 9 (enter)

Enter matrix2: 0 2 4 1 4.5 2.2 1.1 4.3 5.2 (enter)

The multiplication of the matrices is

1 2 3           0 2.0 4.0               5.3 23.9 24

4 5 6     *     1 4.5 2.2     =       11.6 56.3 58.2

7 8 9           1.1 4.3 5.2            17.9 88.7 92.4

In: Computer Science

1. Which of the following statements is NOT true about the Revenue Management? a. Revenue management...

1. Which of the following statements is NOT true about the Revenue Management?
a. Revenue management is based on setting and updating prices.
b. Revenue management is originated in the airline industry.
c. Through revenue management, the firms can allocate their capacity to different fare classes over time in order to maximize revenue.
d. Revenue management focuses on shaping demand via controlling supply under the limited capacity.

2. According to the Littlewood’s Rule, which of the following does NOT generate pressure to increase the booking limit?
a. Increase in the full-fare price
b. Increase in the discount-fare price
c. Increase in the plane capacity
d. Decrease in the average full-fare demand

3. A hotel has 200 rooms and the historical show rate is 90%. What will be the (closest) optimal overbooking level given by the deterministic overbooking heuristic?
a. 222
b. 180
c. 200
d. None of the above
e. 220

In: Finance

Which of these items would be considered sexual harassment in the eyes of the law? Which...

Which of these items would be considered sexual harassment in the eyes of the law?

Which “type” of harassment is it:   Quid Pro Quo or Hostile Environment?  

1. A client pressures a salesperson for dates and sexual favors in exchange for a large purchase.

2. A supervisor requires that her assistant, a male, stay with her in her hotel room while they are out of town at a conference stating: “If you won’t agree to help me save expenses, I’ll find a new assistant who will.”

3. A male has asked two female co-workers to stop embarrassing him by telling jokes of a sexual nature and sharing their sexual fantasies, but they continue, telling him “you should appreciate the free advice!”

4. When she asked her co-workers to clean up their language, they no longer spoke directly to her but continued to use demeaning terms with each other, especially when referring to her within her earshot.

In: Operations Management

Strategic Planning in Health Care Organizations Porter’s Five Forces focus on competitive forces that affect an...

Strategic Planning in Health Care Organizations

Porter’s Five Forces focus on competitive forces that affect an organization. In many industries, including the healthcare industry, there are complementary products and services that add values to consumers. For example, the airline and hotel industries are complementary to each other and create values to travelers by transporting them and housing them during their vacations or business trips. It is also common for these complementary businesses to enter into a strategic alliance to promote each other’s products or services. *Give an example of a complementary product or service (“complementor”) in the healthcare industry * Explain why the

“complementors” add values and whether a business alliance between these two complementary businesses is a sound strategic move

. Reference Your paper must be 1–2 pages

Ginter, P. M., Duncan, J. W., & Swayne, L. E. (2013). The strategic management of healthcare organizations (7th ed.). San Francisco, CA: Jossey-Bass.

In: Nursing

Many U.S. Firms Use Leases Leasing is big business for U.S. companies. For example, business investment...

Many U.S. Firms Use Leases Leasing is big business for U.S. companies. For example, business investment in equipment in a recent year totaled $709 billion. Leasing accounted for about 31% of all business investment ($218 billion). Who does the most leasing? Interestingly major banks, such as Continental Bank, J.P. Morgan Leasing, and US Bancorp Equipment Finance, are the major lessors. Also, many companies have established separate leasing companies, such as Boeing Capital Corporation, Dell Financial Services, and John Deere Capital Corporation. And, as an excellent example of the magnitude of leasing, leased planes account for nearly 40% of the U.S. fleet of commercial airlines. In addition, leasing is becoming increasingly common in the hotel industry. Marriott, Hilton, and InterContinental are increasingly choosing to lease hotels that are owned by someone else. Why might airline managers choose to lease rather than purchase their planes?

In: Accounting

Provide an evaluation of two proposed projects, both with 5-year expected lives and identical initial outlays...

Provide an evaluation of two proposed projects, both with 5-year expected lives and identical initial outlays of $110,000. Both of thj4ese projects involve additions to Liburdi’s high highly successful hotel product line, and as a result, the required rate of return on both projects has been established at 12 percent. The expected free cash flows from each project are as follows:

Project A

Project B

Initial outlay

-$110,000

-$110,000

Inflow year 1

20,000

40,000

Inflow year 2

30,000

40,000

Inflow year 3

40,000

40,000

Inflow year 4

50,000

40,000

Inflow year 5

70,000

40,000

In evaluating these projects, please respond to the following questions:

  1. What are the criticisms of the payback period?
  2. Describe in your own words the logic behind the NPV?
  3. Would you expect the NPV and PI methods to give consistent accept/reject decisions? Why or Why not?

In: Accounting

How do demand and supply change, and thus what are the impacts on price and quantity,...

How do demand and supply change, and thus what are the impacts on price and quantity, due to the following changes:

1. Higher household income

2. Swiss residents become “greener“

3. Firms want to strongly position their newly-launched models

4. Plastic becomes more expensive

5. Oil becomes more expensive

6. Hotel prices in ski resorts become higher

7. Guest workers are no longer allowed in the country

8. New ski resorts open up

9. The lifts themselves become faster and less expensive to purchase and operate

10.Higher availability of inexpensive, high quality printers for private use 1

1. Higher availability of notebooks and PCs with high-quality graphics

12. Higher availability of e-mail and social media

13. Rising productivity and falling prices for inputs in the production of digital cameras

14. Higher availability of handy, and then smart phones, with digital cameras

In: Economics

Managing Conflict" Please respond to the following: Your bags are packed for a family vacation to...

Managing Conflict" Please respond to the following:

Your bags are packed for a family vacation to Jamaica, and you leave in three days. There is no way that you can get a refund since you purchased your airfare and hotel through a special offer on a travel website. Your co-worker calls out of work for one week, saying her child has the flu and she can’t come to work because she has no one to watch her child. Your supervisor says you have to cover that co-worker's shift AGAIN for the fourth time in two months. Unfortunately, if you cover the shift you will miss your vacation, and you will lose the money you spent on it. How would you manage this job conflict, and why? Do you: Avoid your supervisor and call out sick Collaborate with your supervisor to come up with a solution Accommodate your supervisor and skip your vacation

In: Operations Management

1. Describe the main difference between direct materials and indirect materials that are used in any...

1. Describe the main difference between direct materials and indirect materials that are used in any given production process.

2. The Cheepencheerful Bakery Company produces muffins that it sells to hotel chains in the city. It generally breaks even at the end of the year but not always. It only knows this when the company’s external accountants prepare financial statements that are used by the bank and to file tax returns. The company does its best to keep its costs down and as a result does not pay its employees very much.

When the president’s wife, who is the bookkeeper, decided to retire, the president advertised for her replacement. He felt he could find someone who would work for slightly more than minimum wage. This would be in line with his desire to keep costs down.

Comment on the president’s desire to keep his costs down by hiring a poorly paid accountant for his organization.

In: Accounting

In early March, 2020, our state government announced tentative plans to move homeless people in to...

In early March, 2020, our state government announced tentative plans to move homeless people in to college dorm rooms. A. In your opinion, is this idea a good idea? Or a bad idea? Why? B. Would you make this program voluntary for homeless people? Or mandatory? Why? C. How vigorously would you enforce this program? Why? D. What penalties, if any, would you impose on homeless people for non-compliance? Why? E. In theory, what could ‘go wrong’ with the enforcement of this program? What other support services do homeless people require, in addition to housing? F. Moving homeless people into hotel rooms, (combined with support services), which our state has done on an unprecedented level, may be a better idea than moving them into college dorms. Why? G. In your opinion, what more should we be doing as a society to address this issue? Why?

In: Economics