1. Adapt the custom array list implementation code with the following changes:
(a) Add code to the ensureCapacity() method to print out a message including how many elements are copied to the new array on resizing
Array List Implementation:
public class MyArrayList<E> implements MyList<E> {
public static final int INITIAL_CAPACITY = 16;
private E[] data = (E[])new Object[INITIAL_CAPACITY];
private int size = 0; // Number of elements in the list
public MyArrayList() {
}
public MyArrayList(E[] objects) {
for (int i = 0; i < objects.length; i++)
add(objects[i]);
}
@Override
public void add(int index, E e) {
if (index < 0 || index > size)
throw new IndexOutOfBoundsException
("Index: " + index + ", Size: " + size);
ensureCapacity();
for (int i = size - 1; i >= index; i--)
data[i + 1] = data[i];
data[index] = e;
size++;
}
private void ensureCapacity() {
if (size >= data.length) {
E[] newData = (E[])(new Object[size * 2 + 1]);
System.arraycopy(data, 0, newData, 0, size);
data = newData;
}
}
@Override
public void clear() {
data = (E[])new Object[INITIAL_CAPACITY];
size = 0;
}
@Override
public boolean contains(Object e) {
for (int i = 0; i < size; i++)
if (e.equals(data[i])) return true;
return false;
}
@Override
public E get(int index) {
checkIndex(index);
return data[index];
}
private void checkIndex(int index) {
if (index < 0 || index >= size)
throw new IndexOutOfBoundsException
("Index: " + index + ", Size: " + size);
}
@Override
public int indexOf(Object e) {
for (int i = 0; i < size; i++)
if (e.equals(data[i])) return i;
return -1;
}
@Override
public int lastIndexOf(E e) {
for (int i = size - 1; i >= 0; i--)
if (e.equals(data[i])) return i;
return -1;
}
@Override
public E remove(int index) {
checkIndex(index);
E e = data[index];
for (int j = index; j < size - 1; j++)
data[j] = data[j + 1];
data[size - 1] = null;
size--;
return e;
}
@Override
public E set(int index, E e) {
checkIndex(index);
E old = data[index];
data[index] = e;
return old;
}
@Override
public String toString() {
StringBuilder result = new StringBuilder("[");
for (int i = 0; i < size; i++) {
result.append(data[i]);
if (i < size - 1) result.append(", ");
}
return result.toString() + "]";
}
public void trimToSize() {
if (size != data.length) {
E[] newData = (E[])(new Object[size]);
System.arraycopy(data, 0, newData, 0, size);
data = newData;
}
}
@Override
public java.util.Iterator<E> iterator() {
return new ArrayListIterator();
}
private class ArrayListIterator
implements java.util.Iterator<E> {
private int current = 0;
@Override
public boolean hasNext() {
return (current < size);
}
@Override
public E next() {
return data[current++];
}
@Override
public void remove() {
MyArrayList.this.remove(current);
}
}
@Override
public int size() {
return size;
}
}
In: Computer Science
Over the last few decades, the income sources for banks have changed. Outline the changes and discuss why non-interest income has become so important to banks?
In: Finance
The commercial banking industry is undergoing rapid changes due to advances in technology and competitive pressures in the financial services sector. The data file BANKS contains selected information tabulated by Fortune concerning the revenues, profitability, and number of employees for the 51 largest US Commercial Banks in terms of revenues. Use the information in this file to complete the following:
a. Compute the mean, median and standard deviation for the three variables: revenues, profits and number of employees. Assume the data is defined as a population. (So since it's a population, would we use STDEV or STDEV.P ???)
b. Convert the data for each variable to z value. (Step-by-step explanation of finding z values). Consider Mellon Bank Corporation headquarters in Pittsburgh. How does it compare to the average bank in the study on the three variables? Discuss.
c. As you can see by examining the data and by looking at statistics computed in part (a), not all banks had the same revenue, same profit or the same number of employees. Which variable had the greatest relative variation among the banks in the study?
d. Calculate a new variable: profits per employee. Develop a frequency distribution and histogram for this new variable. Also compute the mean, median and standard deviation for the new variable. Write a short report that describes the profits per employee for the banks.
e. Referring to part (d), how many banks had a profit-per-employee ratio that exceeded 2 standard deviations from the mean?
| Name | Revenues | Profits | Employees |
| CITICORP | 34697 | 3591 | 93700 |
| CHASE MANHATTAN CORP. | 30381 | 3708 | 69033 |
| BANKAMERICA CORP. | 23585 | 3210 | 77000 |
| NATIONSBANK CORP. | 21734 | 3077 | 80360 |
| J.P.MORGAN & CO. | 17701 | 1465 | 16943 |
| FIRST UNION CORP. | 14329 | 1896 | 43933 |
| BANC ONE CORP. | 13219 | 1306 | 56600 |
| BANKERS TRUST N.Y. CORP. | 12176 | 866 | 18286 |
| FIRST CHICAGO NBD CORP. | 10098 | 1525 | 33962 |
| aMSOUTH BANCORP. | 9660 | 1351 | 55729 |
| WELLS FARGO & CO. | 9608 | 1155 | 33100 |
| FLEET FINANCIAL GROUP | 8095 | 1303 | 32317 |
| U.S. BANCORP | 6909 | 839 | 25858 |
| PNC BANK | 6859 | 1052 | 24814 |
| BANKBOSTON CORP. | 6727 | 879 | 21500 |
| KEYCORP | 6568 | 919 | 24595 |
| BANK OF NEW YORK CO. | 5697 | 1104 | 16494 |
| WACHOVIA CORP. | 5270 | 593 | 21652 |
| NATIONAL CITY CORP. | 5152 | 807 | 29841 |
| MELLON BANK CORP. | 5134 | 771 | 27500 |
| SUNTRUST BANKS | 4585 | 667 | 21227 |
| MBNA | 4524 | 623 | 17398 |
| CORESTATES FINAN. CORP. | 4379 | 813 | 18847 |
| BARNETT BANKS | 4102 | 255 | 21487 |
| REPUBLIC NEW YORK CORP. | 3738 | 449 | 5900 |
| STATE ST. CORP. | 3428 | 380 | 14199 |
| COMERICA | 3175 | 530 | 11000 |
| BB&T CORP. | 2598 | 360 | 9803 |
| SOUTHTRUST CORP. | 2503 | 307 | 10311 |
| SUMMIT BANCORP | 2367 | 371 | 8566 |
| HUNTINGTON BANCSHARES | 2324 | 293 | 9485 |
| NORTHERN TRUST CORP. | 2267 | 309 | 7553 |
| MERCANTILE BANCORP. | 2257 | 205 | 9510 |
| FIRST OF AMER. BANK CORP. | 2078 | 315 | 10622 |
| CRESTAR FINANCIAL CORP. | 1997 | 310 | 8215 |
| FIFTH THIRD BANCORP | 1924 | 401 | 6787 |
| REGIONS FINANCIAL | 1912 | 300 | 9227 |
| FIRSTAR CORP. | 1893 | 295 | 7755 |
| UNION PLANTERS CORP. | 1778 | 209 | 7711 |
| MARSHALL & ILSLEY CORP. | 1743 | 245 | 10227 |
| POPULAR | 1739 | 210 | 8854 |
| AMSOUTH BANCORP. | 1644 | 226 | 6400 |
| FIRST TENN. NATL. CORP. | 1609 | 197 | 8207 |
| FIRST SECURITY CORP. | 1503 | 206 | 7673 |
| OLD KENT FINANCIAL CORP. | 1306 | 180 | 6328 |
| FIRST EMPIRE STATE CORP. | 1258 | 176 | 4781 |
| PACIFIC CENTURY FINANCIAL | 1250 | 139 | 5114 |
| PROVIDIAN FINANCIAL | 1217 | 191 | 3884 |
| SYNOVUS FINANCIAL CORP. | 1215 | 165 | 7496 |
| COMPASS BANCSHARES | 1131 | 156 | 5060 |
| FIRST NATL. OF NEBRASKA | 1047 | 75 | 5200 |
In: Statistics and Probability
: FRS121- The Effect of Changes in Foreign Exchange Rates
On 1 January 2007, Ally Enterprise Sdn Bhd (AESB) acquired all the issued share capital of Jedi Ptd. Ltd (JPL) in Singapore. The subsidiary is wholly dependent on the parent for goods and the parent determines sales prices. The summarized financial statements of JPL are as follows:
Statement of Comprehensive Income for the year ended 31 December 2007
|
$S’000 |
$S’000 |
|
|
Sales Revenue |
2,850 |
|
|
Purchases |
2,400 |
|
|
Closing Inventory |
(400) |
2,000 |
|
Gross Profit |
850 |
|
|
Depreciation |
100 |
|
|
Admin Costs |
200 |
|
|
Rental |
50 |
(350) |
|
Net Profit |
500 |
Statement of Financial Positions as at 31 December 2007
|
$S’000 |
$S’000 |
|
|
Plant, Property & Equipment (net) |
600 |
|
|
Current Assets |
||
|
Inventory |
400 |
|
|
Bank |
200 |
600 |
|
Creditors |
(400) |
|
|
800 |
||
|
Ordinary Shares at $S1 each |
100 |
|
|
Retained profit |
200 |
|
|
Net Profit |
500 |
|
|
800 |
The exchange rates are as follows:
Date when PPE were acquired by AESB RM1: $S0.45
1 January 2007 RM1: $S0.44
31 December 2007 RM1: $S0.46
Average rate for 2007 RM1: $S0.45
Closing Stocks were bought at RM1: $S0.43
You are required to:
i). Translate the Statement of Comprehensive Income into the functional currency of the parent.
ii). Translate the Statement of Financial Positions into the functional currency of the parent.
In: Accounting
Milton Friedman argued, and new classical economists continue to argue (or presume) that changes in our actual or current income do not any significant effect on our actual or current consumption spending, or that our MPC is essentially zero. What was Friedman’s argument? Why did he make this argument?
In: Economics
Using the standard values of enthalpy changes (ΔH°) and entropy change (ΔS°) to calculate the Gibbs free energy change for the production of following metallic elements from their ore sources: (a) 2ZnO(s) 2Zn(s) + O2(g) (b) 2CaO(s) 2Ca(s) + O2(g) (c) 2Al2O3(s) 4Al(s) + 3O2(g) (d) 2MgO(s) 2Mg(s) + O2(g)
In: Chemistry
Write a 5-10 sentence conclusion describing the changes in temperature for a solid, liquid, and gas affect the amount of energy and types of motion that each phase has and the randomness of motion. Use some of the observations to justify your conclusion.
In: Physics
given a diagnostic radiograph, describe how the exposure technique would be adjusted for individual changes in mAs or exposure time, kVp, grid ratio, beam collimation, SID, film-screen RS, and patient thickness
In: Physics
Read the following article in the link below and answer the following questions
ARTICLE (BELOW): Changes to the elevational limits and extent of species ranges associated with climate change
www.uam.es/personal_pdi/ciencias/jspinill/BIBLIOGRAFIA_CASO/ECOL_2005_8_1138_1146.pdf
=========================================================================================
1. What is the larger ecological issue that the authors would like to address (found in the first paragraph of the introduction)?
2. What is the specific study question and/or hypothesis (or hypotheses) addressed in the paper?
3. What did the authors do? Briefly (in 2 sentences max) describe the methods or approach of the study.
4. What did the authors find? Briefly (2 sentences max) describe the most important result/finding and indicate which figure or table shows this result. This should be the answer to the specific study question or an evaluation of whether the hypothesis was supported.
In: Biology
1. What do retrospective and prospective mean as they relate to Accounting changes?
2. Select a type of accounting change. Provide an example of how that change might apply to your favorite company. What are the financial statement implications of your change? Why?
In: Accounting