Questions
Ivanhoe Ltd. purchased a new machine on April 4, 2014, at a cost of $188,000. The...

Ivanhoe Ltd. purchased a new machine on April 4, 2014, at a cost of $188,000. The company estimated that the machine would have a residual value of $18,000. The machine is expected to be used for 10,000 working hours during its four-year life. Actual machine usage was 1,400 hours in 2014; 2,200 hours in 2015; 2,300 hours in 2016; 2,100 hours in 2017; and 2,000 hours in 2018. Ivanhoe has a December 31 year end.

Calculate depreciation for the machine under each of the following methods: (Round expense per unit to 2 decimal places, e.g. 2.75 and final answers to 0 decimal places, e.g. 5,275.)

(1) Straight-line for 2014 through to 2018.
2014 expense $enter a dollar amount
2015 expense $enter a dollar amount
2016 expense $enter a dollar amount
2017 expense $enter a dollar amount
2018 expense $enter a dollar amount


(2) Diminishing-balance using double the straight-line rate for 2014 through to 2018.
2014 expense $enter a dollar amount
2015 expense $enter a dollar amount
2016 expense $enter a dollar amount
2017 expense $enter a dollar amount
2018 expense $enter a dollar amount


(3) Units-of-production for 2014 through to 2018.
2014 expense $enter a dollar amount
2015 expense $enter a dollar amount
2016 expense $enter a dollar amount
2017 expense $enter a dollar amount
2018 expense $enter a dollar amount
Which method results in the highest depreciation expense over the life of the asset? Highest net income? Highest cash flow?


Which method results in the highest net income?


Which method results in the highest cash flow?

In: Accounting

Sheridan Ltd. purchased a new machine on April 4, 2017, at a cost of $164,000. The...

Sheridan Ltd. purchased a new machine on April 4, 2017, at a cost of $164,000. The company estimated that the machine would have a residual value of $16,000. The machine is expected to be used for 14,800 working hours during its four-year life. Actual machine usage was 1,400 hours in 2017; 2,100 hours in 2018; 2,400 hours in 2019; 2,300 hours in 2020; and 2,000 hours in 2021. Sheridan has a December 31 year end.

Calculate depreciation for the machine under each of the following methods: (Round expense per unit to 2 decimal places, e.g. 2.75 and final answers to 0 decimal places, e.g. 5,275.)

(1) Straight-line for 2017 through to 2021.

2017 expense

$enter a dollar amount

2018 expense

$enter a dollar amount

2019 expense

$enter a dollar amount

2020 expense

$enter a dollar amount

2021 expense

$enter a dollar amount



(2) Diminishing-balance using double the straight-line rate for 2017 through to 2021.

2017 expense

$enter a dollar amount

2018 expense

$enter a dollar amount

2019 expense

$enter a dollar amount

2020 expense

$enter a dollar amount

2021 expense

$enter a dollar amount



(3) Units-of-production for 2017 through to 2021.

2017 expense

$enter a dollar amount

2018 expense

$enter a dollar amount

2019 expense

$enter a dollar amount

2020 expense

$enter a dollar amount

2021 expense

$enter a dollar amount

  

3. Which method results in the highest depreciation expense over the life of the asset? Highest net income? Highest cash flow?

4. Which method results in the highest net income?

5. Which method results in the highest cash flow?

In: Accounting

Assessed Value Heating Area Age 184400 2000 3.42 177400 1710 11.50 175700 1450 8.33 185900 1760...

Assessed Value Heating Area Age
184400 2000 3.42
177400 1710 11.50
175700 1450 8.33
185900 1760 0.00
179100 1930 7.42
170400 1200 32.00
175800 1550 16.00
185900 1930 2.00
178500 1590 1.75
179200 1500 2.75
186700 1900 0.00
179300 1390 0.00
174500 1540 12.58
183800 1890 2.75
176800 1590 7.17

Write-up a short summary in current APA format of the results. Be sure to include the resulting model (equation) for the relationship determined by the regression analysis. Your summary should also include a discussion regarding the statistical significance of each of the independent variables and an explanation of the results.

The proper steps in order for multiple regression are:

Global test

  1. Each I.V. - identify the P-value of the highest non-sig variable and eliminate that variable.
  2. Re-run the analysis to see if any more can be removed...and repeat until all I.V. are significant.
  3. Assess for multicollinearity
  4. Assess for autocorrelation & normal probability
  5. Develop the regression equation.

*Please shoe excel formulas when applicable.

In: Statistics and Probability

The National Collegiate Athletic Association (NCAA) requires Division II athletes to score at least 820 on...

The National Collegiate Athletic Association (NCAA) requires Division II athletes to score at least 820 on the combined mathematics and reading parts of the SAT in order to compete in their first college year. The scores of the 1.5 million high school seniors taking the SAT last year are approximately Normal with mean 1026 and standard deviation 209. For an SRS size 200

1) Find the mean and standard deviation of x bar

2) What is the distribution of x bar?

3) What is the probability that a sample mean value exceeds 1028?

4) The highest 2.5% of sample mean value are higher than ____

5) Has the average score increased since last year? To answer this, do the followings:

I. A SRS size 200 gives a sample mean of 1028. State hypotheses, find the test statistic, pvalue, and express your conclusion using a significance level of α=2.5%.

a. Hypotheses (Use notations)

b. test statistic

c. pvalue

d. Conclusion? Include practical terms.

II. Find a 95% confidence interval for the mean SAT score.

In: Math

ELECTRON CONFIGURATIONS andEFFECTIVE NUCLEAR CHARGE (Zeff) INTRODUCTION This assignment is designed to accompany lecture and text...

ELECTRON CONFIGURATIONS andEFFECTIVE NUCLEAR CHARGE (Zeff) INTRODUCTION This assignment is designed to accompany lecture and text regarding how properties of the elements depend on their electron configurations. The questions are intended to help you reach a higher level of mastery in using the quantum mechanics model. This assignment will count in the miscellaneous category of your grade for 25 points. We will work on it together as a class during lecture on Wednesday, March 1, then you will have time to work on it at home. It will be due Monday, March 6. The principles and results of quantum mechanics are generally far removed from our sensory experience and thus present a challenge to our understanding. However, we can gain confidence in the usefulness of the theory when we recognize that it allows us to predict or explain many properties of atoms that can be confirmed by measurement. Among these properties are charges of common ions, ratios in which elements combine to form compounds, atomic radius, ionization energy, electron affinity, paramagnetism, and atomic and molecular spectra. We can give reasonable explanations for many of these properties by making use of a small number of fundamental principles that come from the quantum mechanics model. The first is that we can use the aufbau principle, Hund’s rule, and predictions of the energy level ranking of orbitals to create an electron configuration of an atom. The electron configuration essentially summarizes a model of the atom in terms of the distribution of the mass and charge of electrons about the nucleus. The second is that we can analyze the net attraction of any electron for the nucleus (hence its motivation to stay in the atom) as the net effect of four factors: a) the electrostatic attraction between the electron and the nucleus, b) the average distance of the electron from the nucleus, c) The electrostatic repulsion caused by the presence of other electrons in the atomic system, and d) the magnetic interaction lowering electron energy when other electrons have like spin and raising the energy when others have opposite spin. One way to combine these factors is to start with the charge of the protons in the nucleus (a) and think of the other factors (b-d) as modifying it to give an effective nuclear charge. The third principle to consider is that most of the properties of an atom depend primarily on only the electrons at greatest average distance from the nucleus, i.e., those electrons sharing the highest principle quantum number present. These are referred to as the valence or outer-shell electrons. If we determine which electrons these are from an electron configuration and consider the strength of the effective nuclear charge at their average distance, we can make meaningful comments about how those electrons might behave in determining atomic properties. The text (pp. 306-307) and perhaps your instructor have referred to the concept of effective nuclear charge. It is usually discussed qualitatively, without attempting to assign a numerical value to it. In advanced texts, various methods have been proposed to give approximate values from calculations. Strictly for the sake of this exercise, let us adopt an approximating system. It may appear rather clumsy at first, and it is not accurate for elements in general. However, it does give relatively good estimates for elements of low atomic number and only requires simple arithmetic. The estimate of the effective nuclear charge, Zeff, as felt by the highest energy valence electron in an atom will be calculated as follows. HOW TO DETERMINE Zeff Determine which is the highest energy valence electron. It should have or share the highest principle quantum number, n, and of those at level n, it should have the highest azimuthal quantum number, l. If several electrons fit that description (i.e., there are several in the highest-energy valence subshell), choose an electron whose spin quantum number is in the minority. This will be the electron whose point of view we will take. Since an electron does not attract or repel itself, do not include this electron in the accounting below. i) Start with the number of protons in the nucleus, this is the atomic number, Z. ii) Subtract 0.95 times the number of electrons at lower principle quantum numbers than the one we are focusing on. These are inner-shell electrons. They are the most efficient at screening outer electrons from the nuclear attraction. iii) Subtract 0.85 times the number of electrons at the same principle quantum number, but with lower azimuthal quantum number, l (i.e., those at a lower energy subshell). iv) Subtract 0.75 times the number of electrons in the same subshell. Remember not to count the electron whose point of view we are taking. v) Add 0.1 for each other electron in the same subshell with the same spin as the one we are considering. vi) Subtract 0.1 for each other electron with the opposite spin. vii) Add 0.05 is this last subshell is full. In the two examples below, note the double arrow indicates a highest energy electron and that the steps are applied with regard to the other electrons. Example 1. Beryllium, Be 1s  2s  Z = 4 (atomic no.) - 0.95 × 2 (the 1s electrons are “inner shell” relative to n = 2) - 0.85 × 0 (no lower subshell than the 2s at n = 2) - 0.75 × 1 (the other 2s electron, same subshell) + 0.10 × 0 (no other 2s electron with same spin) - 0.10 × 1 (the other 2s electron has opposite spin) + 0.05 (last subshell, 2s, is full) Zeff = 1.3 Example 2. Fluorine, F 1s  2s  2p    Z = 9 (atomic no.) - 0.95 × 2 (the 1s electrons are “inner shell” relative to n = 2) - 0.85 × 2 (the 2s is a lower subshell than the 2p at n = 2) - 0.75 × 4 (the other 2p electrons, same subshell) + 0.10 × 1 (one other 2p electron with same spin) - 0.10 × 3 (the other 2p electrons have opposite spin) + 0.00 (last subshell, 2p, is not full) Zeff = 2.2 What can this comparison tell us? Both Be and F have electrons at n = 2. If all else was equal, that would suggest the same radius. But since the outer electrons of F experience a greater net attraction to the nucleus, F is actually smaller in radius. The smaller average distance and greater net attractive charge makes it require more energy to remove an electron from F, i.e., F has higher first ionization energy. If we add a new electron to each atom and perform the Zeff calculation again we can compare the attraction to the electron of highest energy in each ion, Be- and F-. The values are Zeff = 0.4 for Be- and Zeff = 1.6 for F-. This suggests that the added electron in F-would be more strongly attracted, so F has a more negative electron affinity (more energy is released upon adding an electron to a neutral F atom). Try adding another electron to F-. The eleventh electron would have to go to the 3s orbital making the other ten electrons inner shell. The value of Zeff for the outer electron would be -0.5. This explains why fluorine always takes on a -1 charge in its ionic compounds, not -2. This brief analysis should suggest how much information can be explained by analyzing electron configurations. The report for this experiment asks you to consider some comparisons and give reasonable explanations for the observations based on electron configurations. The exercise should help you to become more comfortable with the terms and symbols of quantum mechanics as well as clarifying the trends in properties observed for elements in rows and columns of the periodic table. In explaining the comparisons, you may sometimes find that there is conflicting information. If two elements or ions have the same Zeff, a higher principle quantum number would indicate greater average distance from the nucleus and thus a weaker force of attraction. If two elements have the same principle quantum number for the outer shell, then a greater Zeff would indicate a stronger attraction of electrons for the nucleus. But what if you are comparing two elements where one has a greater value for n and a higher Zeff? Based on the information we have available, we can not decide, from theory, which factor would be more influential. For this reason, the report questions will not ask you to predict an unknown comparison of properties. Instead, we merely need to explain a comparison whose outcome we already know from experimental information. ANSWERING ASSIGNMENT QUESTIONS In answering the questions, bring all of the tools we have discussed to bear on the issue. Show electron configurations, use Zeff calculations from class, compare energy levels and principle quantum numbers, etc. Decide what factors support the comparison and what (if any) factors work against it. Since we know the conclusions, you can state which must have been the more significant factors. You may refer to the text for assistance but do not merely repeat what is written there. Summarize the rationale for each item to prepare for writing the assignment. The assignment should be done on separate paper; it can be typed or handwritten. If possible, please type at least the written portion of your answers, at 1.5 spacing. Use complete sentences in paragraph form. When you include diagrams or show calculations, organize them separately so that they do not break up the continuity of the written arguments. You should label your diagrams and calculations so that they can be referenced in your written arguments. Be sure to label each of the ten responses. For species that appear in more than one question, you do not need to repeat diagrams and Zeff calculations, but do re-reference the prior figures and calculations.

ASSIGNMENT QUESTIONS

1. ATOMIC RADIUS. There are two trends in radius associated with the A-group elements of the periodic table: increase in radius for elements lower in columns and decrease in radius from left to right across a row. As examples, explain why: a) Sodium has a larger radius than lithium. b) Magnesium has a smaller radius than sodium. In questions 2-4, you may use radius comparisons as given information.

2. IONIZATION ENERGY. Ionization energy refers to energy required to remove an outer electron from an isolated atom. The energy tends to be less for elements with weaker attractions to the nucleus or higher initial energy levels. The general trend is for lower energy for elements lower in columns and higher energy from left to right across rows of the periodic table. There are some notable exceptions. Explain why: a) Lithium has higher ionization energy than sodium. b) Fluorine has higher ionization energy than boron. c) Oxygen has lower ionization energy than nitrogen.

3. ELECTRON AFFINITY. The electron affinity is the energy change occurring when an electron is added to an isolated atom. Values generally become more negative (exothermic) from left to right across rows and less negative for elements lower in columns of the table. Both trends have many exceptions. Explain why: a) The electron affinity is more negative for fluorine than for oxygen. b) The electron affinity is less negative for sodium than for lithium. c) The electron affinity is less negative for nitrogen than for carbon.

4. COMBINING RATIOS. Use an analysis of the electron configurations to explain in detail why magnesium and fluorine would make a compound with the formula MgF2. Explain first the signs and then the values of the oxidation numbers we would assign. 3 / 5

In: Chemistry

Jackson Auto Parts Manufacturer, a U.S. based manufacturer of piston rings and other auto parts sold...

Jackson Auto Parts Manufacturer, a U.S. based manufacturer of piston rings and other auto parts sold parts to a South Korean Auto Manufacturer on December 1, 2020 with payment in 10 million South Korean Won to be received on March 31, 2021. The following exchange rates are relevant:

Date:    Spot Rate                Forward Rate

Dec 1, 2020 $0.0035 $0.0034

Dec 31, 2020 $0.0033 $0.0032

March 31 2021 $0.0038 $0.0032

Assuming Jackson did not hedge its foreign exchange risk, how much foreign exchange gain or loss should it report on its fiscal year end December 31, 2020 financial statements/

Assuming that Jackson did in fact decide to hedge its foreign exchange risk and entered into a forward exchange contract to sell 10 million South Korean Won on December 1, 2020 as a fair value hedge of a foreign currency receivable, what is the net impact on Jackson’s 2020 net income resulting from a fluctuation in the value of the Won? Ignore time value of money.

Defend your answer.

In: Accounting

Calculate the entropy production for the piston-cylinder power producing cycle you analyzed in Problem 1. Consider...

Calculate the entropy production for the piston-cylinder power producing cycle you analyzed in Problem 1. Consider that all heat flows into the system come from a constant temperature source of 1800K and that all heat flows out of the system are to a constant temperature of 250 K. Will this cycle operate? Which process should be altered in order to improve the efficiency of the system or to make it work?

Problem 1:

. A simple, effective electric load leveling technique is to use excess produced electricity to pump water into a hill top reservoirs during off peak hours and then discharging it during peak electrical demand periods. This simple, old style energy storage concept is increasingly being used to have a more effective power generation system. The drawback to this technique is that one has to operate in a hilly or mountainous region. Someone has suggested an alternative that can be applied at any location. In this alternative, a reclaimed concrete mass is to be raised using excess generated electrical power. The density of the reclaimed concrete is the same as concrete. During excess electrical power production periods, this mass will be raised using a pulley-motor combination. During the peak power demands the mass will be lowered using a pulley-electric generator to produce power. The effect of the friction in the pulley is a tangential force that operates at the outer pulley circumference that interfaces with the cable. This force, Ffric, is proportional to the mass being lifted by the following relationship: Ffric = 0.008(lifted weight) [note: the force is proportional to the weight, a force, not the mass]. There is a similar loss in the cable-winding pulley, but the relationship is Fpulley = 0.003(lifted weight). Frictional losses ultimately are converted to heat losses to the environment. The lifting tower containing this mass has an above ground height limit of 30 m and a below ground depth limit of 30 m. The device can be considered to be isothermal during these processes.

In: Mechanical Engineering

    Case: Insourcing/Outsourcing — The FlexCon Piston Decision Perform a quantitative insourcing/outsourcing analysis using the data...

    Case: Insourcing/Outsourcing — The FlexCon Piston Decision

  1. Perform a quantitative insourcing/outsourcing analysis using the data provided. What qualitative issues might affect your final decision? Identify any costs or issues that are not part of your analysis that might affect your decision. What is your recommendation regarding what FlexCon should do with its family of pistons? Support your arguments with evidence gathered during your analysis.
  1. Assume your group decided to outsource the pistons to the external supplier. Identify a plan that would enable FlexCon to carry out this recommendation. Be as thorough as possible.
  1. Discuss the primary reasons when and why insourcing/outsourcing decisions occur.
  1. A major challenge with an insourcing/outsourcing analysis involves gathering reliable data. Discuss the various groups that should be involved when conducting an insourcing/outsourcing analysis such as the one presented in this case. What information can each of these groups provide?
  1. Discuss the major issues associated with an insourcing/outsourcing analysis and decision.

In: Statistics and Probability

There are two parts to this question first part: Consider a production facility, where the present...

There are two parts to this question first part:

Consider a production facility, where the present value of expected future cash inflows from production, V = 80, may fluctuate in line with the random fluctuation in demand (u = 1.4, d = 0.71 per period and the risk-free rate, r = 5%). Suppose management has the option in two years, to contract to half the scale and half the value of the project (c = 50%), and recover $40m (Rc = $40m). Thus, in year 2 management has the flexibility either to maintain the same scale of operations (i.e., receive project value, V, at no extra cost) or contract the scale of operations and receive the recovery amount, whichever is highest. What are the pay-offs of this option at the end nodes (thus in the different states after 2 periods)?

The payoffs, F, of the option in the end note states are respectively: F = 0 , F = 0, F = 20

The payoffs, F, of the option in the end note states are respectively: F = 0 , F = 0, F = 14

The payoffs, F, of the option in the end note states are respectively: F = 196 , F = 100, F = 51

The payoffs, F, of the option in the end note states are respectively: F = 157 , F = 80, F = 41

Second part:

Consider again the production facility (from question above). Again, suppose that management has the option in two years, to halve the scale and the value of the project and recover some value. Thus, in year 2 management has the flexibility either to maintain the same scale of operations or contract the scale of operations, whichever is highest.

For this question, assume the end node pay-offs are 0, 20, 50. Calculate the option value by discounting with the risk neutral probability of 0.5 and a risk free rate of 5%. What is the option value?

In: Finance

My question is on this program I have difficulty i marked by ??? public class SortedSet...

My question is on this program I have difficulty i marked by ???

public class SortedSet { private Player[] players; private int count;

public SortedSet() { this.players = new Player[10]; }

/** * Adds the given player to the set in sorted order. Does not add

* the player if the case-insensitive name already exists in the set.

* Calls growArray() if the addition of the player will exceed the size

* of the current array. Uses an insertion sort algorithm to place the

* new player in the correct position in the set, taking advantage of

* the private swapPlayers method in this class.

* * @param player the player to add

* @return the index where the player was added, or -1 if not added

*/

public int add(Player player) {

My question is how to add sorted order with the player in the case-insensitive

????????????????????????????????????????????????????? and

return -1;

}

/**

* @param name the name of the player to remove

* @return true if removed, false if not found

*/

public boolean remove(String name) {

??????????????????????????????????????????????????????????????????????

How to removes the player with the given case-insensitive name from the set. return true;

}

/**

* @param name the player's name

* @return the index where the player is stored, or -1 if not found

*/

public int find(String name) {

?????????????????????????????????????????????????????????

How to Locates the player with the given case-insensitive name in the set. return 0;

}

/**

* @param index the index from which to retrieve the player

* @return the player object, or null if index is out of bounds.

*/

public Player get(int index) {

?????????????????????????????????????????????????????????

How to returns the player object stored at the given index. return null;

}

/**

* Provides access to the number of players currently in the set.

* @return the number of players */ public int size() { return count;

}

/**

* Provides access to the current capacity of the underlying array.

* @return the capacity of the array

*/

public int capacity() { return players.length;

}

/** Provides a default string representation of th sorted set. Takes

* advantage of Player's toString method to provide a single line String.

* Example: [ (Player: joe, Score: 100) (Player: fred, Score: 98) ]

* @return the string representing the entire set

*/ @Override

public String toString() {

??????????????????????????????????????

How to provides a default string ?????????

return null;

}

/**

* @param i the first index

* @param j the second index

*/

private void swapPlayers(int i, int j) {

??????????????????????????????????????????????????????

How to private method used during sorting to swap players in the underlying array.

}

private void growArray() {

???????????????????????????????????????????????????????????

How to private method used to double the array if adding a new player will exceed the size of the current array.

}

}

//----------------------------------------------------------------------------------------------------------------------------// //

players Classes public class Player implements Comparable {

//

fields private String name; private int score;

/**

* Full constructor.

* @param name the player's name

* @param score the player's highest score

*/

public Player(String name, int score) {

this.name = name; this.score = score;

}

/**

* Provides access to the player's name.

* @return the player's name

*/

public String getName() {

return name;

}

/**

* Allows the player's name to be set.

* @param name the player's name

*/

public void setName(String name) {

this.name = name;

}

/**

* Provides access to the player's highest score.

* @return the player's highest score

*/

public int getScore() {

return score;

}

/**

* Allows the player's highest score to be set.

* @param score the player's highest score

*/

public void setScore(int score) {

this.score = score;

}

/**

* Provides a default string representation of an object of this class.

* @return */ @Override public String toString() {

return "Player: " + name + ", Score: " + score;

}

/** * Provides a unique hash code for this object,

* based on the case-insensitive player name.

* @return the hash code

*/

@Override public int hashCode() {

int hash = 3;

hash = 83 * hash + Objects.hashCode(this.name.toLowerCase());

return hash;

}

/** * Reports if the given object is equal to this object,

* based on the case-insensitive player name.

* * @param obj the object to compare to this one

* @return true if the names are the same, false if not.

*/ @Override

public boolean equals(Object obj) {

if (this == obj) {

return true;

}

if (obj == null) {

return false;

}

if (getClass() != obj.getClass()) {

return false;

}

final Player other = (Player) obj;

return this.name.equalsIgnoreCase(other.name);

}

/** * Compares the given object with this one to determine sort order.

* * @param other the other object to compare to this one

* @return a negative value if this object should come before the other one,

* a positive value if it should come after, or zero if they are the same

*/ @Override public int compareTo(Player other) { return other.score - this.score; } }

//----------------------------------------------------------------------------------------------------------------------------//

// Main class

public class Lab1 {

/** * All tests performed here in main method.

* * @param args the command line arguments

*/

public static void main(String[] args) {

SortedSet set = new SortedSet();

//test insertion for (int i = 0; i < 10; i++) {

if (set.add(new Player(String.valueOf((char) (i + 97)), i + 10)) != 0) {

System.out.println("INSERTION FAIL"); return; }

}

System.out.println("INSERTION PASS");

//test growing array

if (set.add(new Player("k", 9)) != 10) {

System.out.println("GROW FAIL"); return;

}

System.out.println("GROW PASS");

//test duplicate

if (set.add(new Player("D", 5)) != -1) {

System.out.println("DUPLICATE FAIL");

return;

}

System.out.println("DUPLICATE PASS");

//test valid remove

if (!set.remove("c")) {

System.out.println("VALID REMOVE FAIL");

return;

}

System.out.println("VALID REMOVE PASS");

//test invalid remove if (set.remove("z")) {

System.out.println("INVALID REMOVE FAIL");

return;

}

System.out.println("INVALID REMOVE PASS");

//test valid find

if (set.find("g") != 3) {

System.out.println("VALID FIND FAIL");

return;

}

System.out.println("VALID FIND PASS");

//test invalid find

if (set.find("z") != -1) {

System.out.println("INVALID FIND FAIL");

return;

}

System.out.println("INVALID FIND PASS");

//test valid get

if (set.get(0).getScore() != 19) {

System.out.println("VALID GET FAIL");

return;

}

System.out.println("VALID GET PASS");

//test invalid

get if (set.get(100) != null) {

System.out.println("INVALID GET FAIL");

return;

}

System.out.println("INVALID GET PASS");

//test toString method try { String str = set.toString();

if (str.equals("[ (Player: j, Score: 19) (Player: i, Score: 18) " + "(Player: h, Score: 17) (Player: g, Score: 16) " + "(Player: f, Score: 15) (Player: e, Score: 14) " + "(Player: d, Score: 13) (Player: b, Score: 11) " + "(Player: a, Score: 10) (Player: k, Score: 9) ]")) { System.out.println("TOSTRING PASS"); } else { System.out.println("TOSTRING FAIL"); } } catch (Exception e) { System.out.println("TOSTRING FAIL"); } //test proper capacity of array if (set.capacity() != 20) { System.out.println("SIMPLE CAPACITY FAIL"); return; } System.out.println("SIMPLE CAPACITY PASS"); for (int i = 0; i < 100; i++) { set.add(new Player((String.valueOf((char) (i + 97))) + i, i)); } if (set.capacity() != 160) { System.out.println("COMPLEX CAPACITY FAIL"); return; } System.out.println("COMPLEX CAPACITY PASS"); } }

In: Computer Science