Questions
App is crashing at startup? Any idea? Thanks! import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button;...

App is crashing at startup? Any idea? Thanks!
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.Random;

public class MainActivity extends AppCompatActivity {

    private EditText teamOneText;
    private EditText teamTwoText;
    private Button selectButton;
    private TextView resultView;

    Random r = new Random();

    ArrayList<EditText> editTextList = new ArrayList<>();
    ArrayList<String> editTextValues = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        editTextList.add(teamOneText);
        editTextList.add(teamTwoText);

        for(int i=0;i<editTextList.size();i++){
            editTextValues.add(editTextList.get(i).getText().toString());
        }

        teamOneText = findViewById(R.id.team_one);
        teamTwoText = findViewById(R.id.team_two);
        resultView = findViewById(R.id.result_view);
        selectButton = findViewById(R.id.select_button);

        selectButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                resultView.setText(editTextValues.get(r.nextInt(editTextValues.size())));
            }
        });
    }
}

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/result_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Result shown here"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.70" />

    <Button
        android:id="@+id/select_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Select Random Team"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.40" />

    <EditText
        android:id="@+id/team_one"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="Team's name"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.70"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.15" />

    <EditText
        android:id="@+id/team_two"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="Team's name"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.70"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.25" />

    <TextView
        android:id="@+id/team1_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Team 1"
        android:textSize="18sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.15"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.16" />

    <TextView
        android:id="@+id/team2_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Team 2"
        android:textSize="18sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.15"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.26" />

</androidx.constraintlayout.widget.ConstraintLayout>

strings.xml

<resources>
    <string name="app_name">TeamSelector</string>
</resources>

In: Computer Science

Kaelea, Inc., has no debt outstanding and a total market value of $75,000. Earnings before interest...

Kaelea, Inc., has no debt outstanding and a total market value of $75,000. Earnings before interest and taxes, EBIT, are projected to be $9,400 if economic conditions are normal. If there is strong expansion in the economy, then EBIT will be 24 percent higher. If there is a recession, then EBIT will be 31 percent lower. The company is considering a $22,500 debt issue with an interest rate of 8 percent. The proceeds will be used to repurchase shares of stock. There are currently 5,000 shares outstanding. Assume the company has a market-to-book ratio of 1.0. a. Calculate return on equity, ROE, under each of the three economic scenarios before any debt is issued, assuming no taxes. (Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places, e.g., 32.16.) ROE Recession % Normal % Expansion % b. Calculate the percentage changes in ROE when the economy expands or enters a recession, assuming no taxes. (A negative answer should be indicated by a minus sign. Do not round intermediate calculations and enter your answers as a percent rounded to the nearest whole number, e.g., 32.) %ΔROE Recession % Expansion % Assume the firm goes through with the proposed recapitalization and no taxes. c. Calculate return on equity, ROE, under each of the three economic scenarios after the recapitalization. (Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places, e.g., 32.16.) ROE Recession % Normal % Expansion % d. Calculate the percentage changes in ROE for economic expansion and recession. (A negative answer should be indicated by a minus sign. Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places, e.g., 32.16.) %ΔROE Recession % Expansion % Assume the firm has a tax rate of 35 percent. e. Calculate return on equity, ROE, under each of the three economic scenarios before any debt is issued. Also, calculate the percentage changes in ROE for economic expansion and recession. (A negative answer should be indicated by a minus sign. Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places, e.g., 32.16.) ROE Recession % Normal % Expansion % %ΔROE Recession % Expansion % f. Calculate return on equity, ROE, under each of the three economic scenarios after the recapitalization. Also, calculate the percentage changes in ROE for economic expansion and recession, assuming the firm goes through with the proposed recapitalization. (A negative answer should be indicated by a minus sign. Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places, e.g., 32.16.) ROE Recession % Normal % Expansion % %ΔROE Recession % Expansion %

In: Finance

in c++ language This assignment is to give you practice using structs and sorting. In competitive...

in c++ language

This assignment is to give you practice using structs and sorting.

In competitive diving, each diver makes dives of varying degrees of difficulty. Nine judges score each dive from 0 through 10 in steps of 0.5. The difficulty is a floating-point value between 1.0 and 3.0 that represents how complex the dive is to perform. The total score is obtained by discarding the lowest and highest of the judges’ scores, adding the remaining scores, and then multiplying that total by the degree of difficulty. Write a program to score each of the dives, using the following input and output specifications, and determine the winner of the competition.

Input:

Create the file m7divers.txt using the data given at the end.

The first line contains an integer for the number of divers in the competition and subsequent lines contain:
Diver’s name (10 characters max, no blanks included), difficulty (double), and judges’ ratings (nine doubles). There is one line of data for each diver.

Example file: (This is not the data to use)

Anne 2.0 8.0 8.5 8.5 8.5 9.0 9.0 9.0 9.5 9.5 124.0
Sarah 1.6 7.0 7.5 8.0 8.0 8.0 8.5 8.5 8.5 9.0 91.2

Output:

The name and difficulty, followed by the scores sorted into increasing order, in tabular form with appropriate headings along with the earned total points for that dive.

Example for sample data above

NAME DIFF SORTED SCORES         POINTS
Anne 2.0 8.0 8.5 8.5 8.5 9.0 9.0 9.0 9.5 9.5 124.0
Sarah 1.6 7.0 7.5 8.0 8.0 8.0 8.5 8.5 8.5 9.0 91.2


At the end of the table, print out the name of the winner of the competition (the person with the highest points) and his/her final score.

Hint: Use functions to modularize your program.

Use this data for your input file. download the data from the attachment.

NAME DIFF SORTED SCORES        
Anne 2.0 8.0 8.5 8.5 8.5 9.0 9.0 9.0 9.5 9.5
Sarah 1.6 7.0 7.5 8.0 8.0 8.0 8.5 8.5 8.5 9.0
Deborah 2.3 9.0 9.0 9.5 10.0 10.0 9.5 9.5 9.5 9.5
Kathryn 2.4 9.0 9.0 9.0 9.5 9.5 9.5 9.0 8.0 8.5
Martha 2.7 9.0 9.0 9.5 9.5 9.0 8.5 8.5 8.5 8.5
Elizabeth 2.9 8.0 8.0 7.5 8.5 8.5 8.0 8.0 7.5 8.5
Tina 2.5 8.5 8.5 8.5 8.5 8.5 8.5 8.5 8.5 8.5

In: Computer Science

Minion, Inc., has no debt outstanding and a total market value of $211,875. Earnings before interest...

Minion, Inc., has no debt outstanding and a total market value of $211,875. Earnings before interest and taxes, EBIT, are projected to be $14,300 if economic conditions are normal. If there is strong expansion in the economy, then EBIT will be 20 percent higher. If there is a recession, then EBIT will be 35 percent lower. The company is considering a $33,900 debt issue with an interest rate of 6 percent. The proceeds will be used to repurchase shares of stock. There are currently 7,500 shares outstanding. Assume the company has a market-to-book ratio of 1.0 and the stock price remains constant

. a-1. Calculate return on equity, ROE, under each of the three economic scenarios before any debt is issued, assuming no taxes. (Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places, e.g., 32.16.)

a-2. Calculate the percentage changes in ROE for economic expansion or recession, assuming no taxes. (A negative answer should be indicated by a minus sign. Do not round intermediate calculations and enter your answers as a percent rounded to the nearest whole number, e.g., 32.)

b-1. Calculate return on equity, ROE, under each of the three economic scenarios after the recapitalization. (A negative answer should be indicated by a minus sign. Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places, e.g., 32.16.)

b-2. Calculate the percentage changes in ROE for economic expansion and recession after the recapitalization. (A negative answer should be indicated by a minus sign. Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places, e.g., 32.16.)

Assume the firm has a tax rate of 21 percent.

c-1. Calculate return on equity, ROE, under each of the three economic scenarios before any debt is issued. Also, calculate the percentage changes in ROE for economic expansion and recession. (A negative answer should be indicated by a minus sign. Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places, e.g., 32.16.)

c-2. Calculate return on equity, ROE, under each of the three economic scenarios after the recapitalization. Also, calculate the percentage changes in ROE for economic expansion and recession, assuming the firm goes through with the proposed recapitalization. (A negative answer should be indicated by a minus sign. Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places, e.g., 32.16.)

In: Finance

Name: ($ in millions) Assets December 31, 2016 December 31, 2017 Dollar Change Source or Use...

Name:

($ in millions)

Assets

December 31, 2016

December 31, 2017

Dollar Change

Source or Use Increase/Decrease

Current Assets

Cash

$           400

$           500

Accounts receivable

           1,510

           1,750

Inventory

           1,179

           1,440

Total Current Assets

$       3,089

$        3,690

Fixed assets

Net plant and equipment

$       5,666

$        6,090

Total Assets

$       8,755

$        9,780

Liabilities and Owners' Equity

Current liabilities

Accounts payable

$           880

$           900

Notes payable

                  -  

                  -  

Total Current Liabilities

$           880

$           900

Long-term debt

           1,500

           1,700

Total Liabilities

$       2,380

$        2,600

Stockholder's equity

Common stock and paid-in surplus

$       1,000

$        1,000

Retained earnings

           5,375

           6,180

Total Stockholder's equity

$       6,375

$        7,180

Total liabilities and stockholders' equity

$       8,755

$        9,780

Increase in Cash

Common-size Income Statement

FYE 12/31/2017

Sales

$10,000

100%

Cost of Goods Sold

           5,350

53.5%

Operating Expenses

           2,250

22.5%

Depreciation

           1,100

11.0%

Earnings Before Interest & Taxes

$1,300

13.0%

Interest Expense

              170

1.7%

Taxable Income

$1,130

11.3%

Taxes

              230

2.3%

Net Income

$900

9.0%

Dividends

$95

1.0%

Addition To Retained Earning

$           805

8.1%

Major Source

Major Use

There are 5 Majors

Cash Flow Activity

Compute ratios to 2 decimals except for Working Capital

December 31, 2016

December 31, 2017

Short-term Solvency/Liquidity

Working Capital

Current Ratio

Quick Ratio

Cash Ratio

Long-term Solvency/Leverage

Total Debt Ratio%

Equity multiplier

Times Interest Earned Ratio

Cash Coverage Ratio

Asset Utilization/Turnover

Inventory Turnover

Day's Sales In Inventory

Receivable Turnover

Day's Sales in Receivables

Operating Cycle in days

Total Asset Turnover

Profitability

Profit Margin%

Return on Assets (ROA)%

Return on Equity (ROE)%

ROE - Using Du Point Identity%

Borrowing Rate

According to the Short-Term Solvency ratios, has Corbett Corporation's liquidity improved or declined?

Answer:

Balance Sheets of December 31, 2016 and 2017 and Income Statement for the Year Ended December 31, 2017 are given below. Please complete columns Dollar Change, Source or Use Increase/Decrease, Major Source/Major Use, and Cash Flow Activity to prove Increase or decrease in Cash. Compute Short-term Solvency/Liquidity for both years to answer whether Corbett Enterprises’ liquidity has improved or declined. Also, compute Long-term Solvency, Asset Utilization, and Profitability ratios for 2017 since only the 2017 income Statement is given.

In: Finance

1) Which of the following solutions is a good buffer system? Which of the following solutions...

1)

Which of the following solutions is a good buffer system?

Which of the following solutions is a good buffer system?

A solution that is 0.10 M HCN and 0.10 M LiCN
A solution that is 0.10 M NaCl and 0.10 M HCl
A solution that is 0.10 M KOH and 0.10 M HNO3
A solution that is 0.10 M HNO3 and 0.10 M KNO3

A solution that is 0.10 M HCN and 0.10 M Na Cl

2)

Calculate the pH of the solution that results from each of the following mixtures.

Part A

55.0 mL of 0.17 M HCHO2 with 70.0 mL of 0.13 M NaCHO2

Express your answer using two decimal places.

Part B

115.0 mL of 0.11 M NH3 with 250.0 mL of 0.11 M NH4Cl

Express your answer using two decimal places.

3)

A 1.0-L buffer solution is 0.125 M in HNO2 and 0.180 M in NaNO2.

Part A

Determine the concentrations of HNO2 and NaNO2 after addition of 1.5 g HCl.

Express your answers using three significant figures separated by a comma.

Part B

Determine the concentrations of HNO2 and NaNO2 after addition of 1.5 g NaOH.

Express your answers using three significant figures separated by a comma.

Part C

Determine the concentrations of HNO2 and NaNO2 after addition of 1.5 g HI.

Express your answers using three significant figures separated by a comma.

4)

A ligand is a molecule or ion that acts as a

A ligand is a molecule or ion that acts as a

Lewis acid
Arrhenius base
conjugate base
Brønsted-Lowry base

Lewis base

5)A buffer contains significant amounts of acetic acid and sodium acetate.

Part A

Write an equation showing how this buffer neutralizes added acid (HCl).

Express your answer as a chemical equation.

Part B

Write an equation showing how this buffer neutralizes added base (Ca(OH)2).

Express your answer as a chemical equation.

6)

When titrating a monoprotic strong acid with a weak base at 25°C, the

When titrating a monoprotic strong acid with a weak base at 25°C, the

pH will be 7 at the equivalence point.
titration will require more moles of the base than acid to reach the equivalence point.
pH will be less than 7 at the equivalence point.
titration will require more moles of acid than base to reach the equivalence point.
pH will be greater than 7 at the equivalence point.

In: Chemistry

Five years ago, a company was considering the purchase of 77 new diesel trucks that were...

Five years ago, a company was considering the purchase of 77 new diesel trucks that were 15.45% more fuel-efficient than the ones the firm is now using. The company uses an average of 10 million gallons of diesel fuel per year at a price of $1.25 per gallon. If the company manages to save on fuel costs, it will save $1.875 million per year (1.5 million gallons at $1.25 per gallon). On this basis, fuel efficiency would save more money as the price of diesel fuel rises (at $1.35 per gallon, the firm would save $2.025 million in total if he buys the new trucks).


Consider two possible forecasts, each of which has an equal chance of being realized. Under assumption #1, diesel prices will stay relatively low; under assumption #2, diesel prices will rise considerably. The 77 new trucks will cost the firm $5 million. Depreciation will be 25.2% in year 1, 38.48% in year 2, and 36.34% in year 3. The firm is in a 40% income tax bracket and uses a 10% cost of capital for cash flow valuation purposes. Interest on debt is ignored. In addition, consider the following forecasts:


Forecast for assumption #1 (low fuel prices):


Price of Diesel Fuel per Gallon

Prob. (same for each year)

Year 1

Year 2

Year 3

0.1

$0.79

$0.92

$1.01

0.2

$0.99

$1.13

$1.12

0.3

$1.12

$1.2

$1.3

0.2

$1.31

$1.44

$1.44

0.2

$1.4

$1.57

$1.6


Forecast for assumption #2 (high fuel prices):


Price of Diesel Fuel per Gallon

Prob. (same for each year)

Year 1

Year 2

Year 3

0.1

$1.22

$1.51

$1.7

0.3

$1.3

$1.71

$2.02

0.4

$1.82

$2.33

$2.49

0.2

$2.21

$2.5

$2.79


Required: Calculate the percentage change on the basis that an increase would take place from the NPV under assumption #1 to the probability-weighted (expected) NPV.


Answer
% Do not round intermediate calculations. Input your answer as a percent rounded to 2 decimal places (for example: 28.31%).



Note: The educational purpose of this problem targets the students’ ability to read + follow instructions.



Further Information (solution steps):



Step (1): Calculate the annual expected price of diesel per gallon under each assumption, based on the probabilities outlined in the inputs section.

Step (2): Using the annual expected fuel prices calculated in step (1), determine the increase in annual savings created by the proposed efficiency for each assumption.

Step (3): Find the increased cash flow after taxes (CFAT) for both forecasts, based on the annual increase in fuel savings determined in step (2) as the increase in earnings before depreciation and taxes (EBDT), and the starting point from which profit is calculated for each assumption. As part of this step, you must establish annual depreciation (remember: depreciation is a noncash charge).

Step (4): Considering the increased annual CFAT produced in step (3), calculate the NPV of the truck purchases for each assumption, based on the discount rate (cost of capital) indicated in the inputs section

Step (5): In view of the outcomes produced in step (4), estimate the combined NPV weighed by the probability of each assumption.

Step (6): Finally, calculate the percentage difference hypothesizing that an increase took place starting from the NPV for assumption #1 to the combined NPV worked out in step (5).

Q1) you will notice as we proceed that the steps are truly consecutive (none can be fulfilled before the step before is complete). therefore, there is truly nothing about the question that's difficult. it's a long question, not a difficult one.

NOTE #1: IT IS EXTREMELY IMPORTANT THAT YOU DO NOT ROUND INTERMEDIATE CALCULATIONS BECAUSE THIS QUESTION IS DESCRIBED BY SEVERAL STEPS … ROUNDING UPON ROUNDING CREATES OVER-ROUNDING AND THEREBY A CONSIDERABLE DIFFERENCE BY THE TIME YOU REACH THE FINAL STEP.

NOTE #2: 10M GALLONS ARE THE SAME ACROSS ALL EXAM SCRIPT FORMS. SAVINGS % VARY.

NOTE #3: IT IS HIGHLY RECOMMENDED THAT YOU DO NOT USE ZEROS AS YOU MULTIPLY × 10 M GALLONS. IT WILL ONLY MAKE YOUR WORKINGS MORE CONFUSING. IF SOMETHING GOES WRONG AT A LATER STAGE, IT WILL BE MUCH EASIER FOR YOU TO IDENTIFY WHERE EXACTLY.

NOTE #4: AS CAN BE OBSERVED IN THE CALCULATIONS ABOVE, SAVINGS ARE CONVERTED FROM % TERMS TO $ TERMS. EACH OF THESE $ ANNUAL SAINGS IS A DIFFERENTIAL (ANNUAL) VALUE IN AN OF ITSELF, DESCRIBED BY A POSITIVE SIGN. AFTER ALL, SAVINGS ARE INFLOWS.

NOTE #5: INTEREST EXPENSE IS IGNORED ACROSS ALL EXAM SCRIPT FORMS.

NOTE #6: THE $5M COST IS THE SAME ACROSS ALL EXAM SCRIPT FORMS. ANNUAL DEPRECIATION % VARIES.

NOTE #7: IMAGINE THAT BY NOW YOU ARE DEALING WITH ZEROS AFTER MULTIPLYING × 10 M GALLONS EARLIER. NOW, YOU WOULD BE FURTHER MULTIPLYONG × $5M COST…


NOTE #8: REMEMBER THAT WE ARE OUTLINING DIFFERENTIAL VALUES HERE AS EXPLAINED IN NOTE #4, THAT’S WHY EACH AFTER-TAX CASH FLOW (ATCF) IS OBSERVED AS AN INCREASE.


NOTE #9: ALSO RECALL FROM PROVISION (ii) ABOVE THAT $ ANNUAL DEPRECIATION MUST BE ADDED BACK TO THE INCREASE IN NET INCOME (HERE, ATCF) ON ACCOUNT THAT DEPRECIATION IS A NON-CASH EXPENSE ITEM.


NOTE #10: IT IS QUITE LIKELY THAT THE NPV FOR THE LOW FUEL PRICES SCENARIO IS GOING TO BE NEGATIVE (IN OTHER WORDS, OUTFLOWS > INFLOWS). THIS IS VERY IMPORTANT TO KEEP IN MIND FOR THE UPCOMING STEP.

NOTE #11: EVEN THOUGH YOU ARE FREE TO USE THE APPENDIX, QUITE CLEARLY, APPENDIX B IN THIS CASE, AS WE ARE DEALING WITH SINGLE AMOUNTS. HOWEVER, IT IS HIGHLY RECOMMENDED THAT YOU USE THE FORMULA ON ACCOUNT THAT YOU SHOULD NOT BE ROUNDING INTERMEDIATE CALCULATIONS. BESIDES, WE ARE ONLY TALKING ABOUT 3 YEARS ONLY. 

NOTE #12: BECAUSE EACH SCENARIO HOLDS A 50% CHANCE OF TAKING PLACE, THE GEOMETRIC MEAN IN THIS PARTICULAR CASE = THE ARITHMETIC MEAN, SUCH THAT BOTH NET PRESENT VALUES CAN BE ADDED, THEN ÷ 2. 


In: Accounting

The Carolina Cougars is a major league baseball expansion team beginning its third year of operation....

The Carolina Cougars is a major league baseball expansion team beginning its third year of operation. The team had losing records in each of its first 2 years and finished near the bottom of its division. However, the team was young and generally competitive. The team’s general manager, Frank Lane, and manager, Biff Diamond, believe that with a few additional good players, the Cougars can become a contender for the division title and perhaps even for the pennant. They have prepared several proposals for free- agent acquisitions to present to the team’s owner, Bruce Wayne.

Under one proposal the team would sign several good available free agents, including two pitchers, a good fielding shortstop, and two power-hitting outfielders for $52 million in bonuses and annual salary. The second proposal is less ambitious, costing $20 million to sign a relief pitcher, a solid, good-hitting infielder, and one power-hitting out- fielder. The final proposal would be to stand pat with the current team and continue to develop.

General Manager Lane wants to lay out a possible season scenario for the owner so he can assess the long-run ramifications of each decision strategy. Because the only thing the owner understands is money, Frank wants this analysis to be quantitative, indicating the money to be made or lost from each strategy. To help develop this analysis, Frank has hired his kids, Penny and Nathan, both management science graduates from Tech.

Penny and Nathan analyzed league data for the previous five seasons for attendance trends, logo sales (i.e., clothing, souvenirs, hats, etc.), player sales and trades, and revenues. In addition, they interviewed several other owners, general managers, and league officials. They also analyzed the free agents that the team was considering signing.

Based on their analysis, Penny and Nathan feel that if the Cougars do not invest in any free agents, the team will have a 25% chance of contending for the division title and a 75% chance of being out of contention most of the sea- son. If the team is a contender, there is a .70 probability that attendance will increase as the season progresses and the team will have high attendance levels (between 1.5 million and 2.0 million) with profits of $170 million from ticket sales, concessions, advertising sales, TV and radio sales, and logo sales. They estimate a .25 probability that the team’s attendance will be mediocre (between 1.0 million and 1.5 million) with profits of $115 million and a .05 prob- ability that the team will suffer low attendance (less than 1.0 million) with profit of $90 million. If the team is not a contender, Penny and Nathan estimate that there is .05 probability of high attendance with profits of $95 mil- lion, a .20 probability of medium attendance with profits of $55 million, and a .75 probability of low attendance with profits of $30 million.

If the team marginally invests in free agents at a cost of $20 million, there is a 50–50 chance it will be a contender. If it is a contender, then later in the season it can either stand pat with its existing roster or buy or trade for players that could improve the team’s chances of winning the division. If the team stands pat, there is a .75 probability that attendance will be high and profits will be $195 million. There is a .20 probability that attendance will be mediocre with profits of $160 million and a .05 probability of low attendance and profits of $120 million. Alternatively, if the team decides to buy or trade for players, it will cost $8 million, and the probability of high attendance with profits of $200 million will be .80. The probability of mediocre attendance with $170 million in profits will be .15, and there will be a .05 probability of low attendance, with profits of $125 million.

If the team is not in contention, then it will either stand pat or sell some of its players, earning approximately $8 million in profit. If the team stands pat, there is a .12 probability of high attendance, with profits of $110 million; a .28 probability of mediocre attendance, with profits of $65 million; and a .60 probability of low attendance, with profits of $40 million. If the team sells players, the fans will likely lose interest at an even faster rate, and the probability of high attendance with profits of $100 million will drop to .08, the probability of mediocre attendance with profits of $60 million will be .22, and the probability of low attendance with profits of $35 million will be .70.

The most ambitious free-agent strategy will increase the team’s chances of being a contender to 65%. This strategy will also excite the fans most during the off-season and boost ticket sales and advertising and logo sales early in the year. If the team does contend for the division title, then later in the season it will have to decide whether to invest in more players. If the Cougars stand pat, the probability of high attendance with profits of $210 million will be .80, the probability of mediocre attendance with profits of $170 million will be .15, and the probability of low attendance with profits of $125 million will be .05. If the team buys players at a cost of $10 million, then the probability of having high attendance with profits of $220 million will increase to .83, the probability of mediocre attendance with profits of $175 million will be .12, and the probability of low attendance with profits of $130 million will be .05.

If the team is not in contention, it will either sell some players’ contracts later in the season for profits of around $12 million or stand pat. If it stays with its roster, the prob- ability of high attendance with profits of $110 million will be .15, the probability of mediocre attendance with profits of $70 million will be .30, and the probability of low attendance with profits of $50 million will be .55. If the team sells players late in the season, there will be a .10 probability of high attendance with profits of $105 million, a .30 probability of mediocre attendance with profits of $65 mil- lion, and a .60 probability of low attendance with profits of $45 million.

Assist Penny and Nathan in determining the best strategy to follow and its expected value.

In: Advanced Math

----- Please solve the questions with the code below. Thank you. ----- Exercise Overview Refactor your...

----- Please solve the questions with the code below. Thank you. -----

Exercise Overview

Refactor your code to enhance the user experience and to use objects and classes.

All functional requirements in Project 1 remain, except where enhancing the system replaces specific functions.

Functional Requirements

  • The console entry point for the user inputs is on the same line as the prompt. (new)
  • User enters name at the beginning of a session.
  • System covers four math operations – addition, subtraction, multiplication, and division – with the user choosing which of the four operations to do in the session. Only 1 type of problem can be done in each session.
    • System should accept the following characters as inputs in both upper- and lower-case: ‘A’ for addition, ‘S’ for subtraction, ‘M’ for multiplication, and ‘D’ for division. (new)
  • User enters additional session parameters from prompts – number of problems to work and the range of values desired in the problems.
  • System presents problems to the user.
    • Entry point for the user response is after the equal sign and a space (‘ = ’). (new)
  • In the ‘Division’ case, division by zero is not allowed. System provides a different factor(s) when the situation occurs. (specified but not truly new)
  • User responds to problems with an answer and the system will provide immediate feedback for each problem, ‘correct’ or ‘incorrect.’
  • System provides summary statistics for the session once all problems are completed. Specifically provide the following 3 types of finishing data (see sample output):
    • Quick Summary: number of problems, number of problems correct, score as indicated by a percentage of problems correct, and the amount of time in seconds required to complete the problems.
    • A complete, space and comma-delimited, unlabeled record of the session – user name, operation type, range of factors, date and time of the session (at end), number of problems, number of problems correct, score shown as the number of correct problems out of the total problems, and the time in seconds spent working on the problems. (new)
    • A list of the problems in the session, including user responses and an indicator of correct/incorrect (see sample output). (new)

Analysis. Describe any analysis that is required for solving the problem, including a discussion of key elements and complex statements or logic of the system.

Design. Describe the major steps for solving the problem (developing the code). A high-level outline of the classes and the variables and methods in the classes is recommended.

Testing. Describe how you tested the system.

----- Please solve the questions with the code below. Thank you. -----

import java.util.Scanner;
import java.util.concurrent.TimeUnit;
import java.time.format.DateTimeFormatter;
import java.time.LocalDateTime;

public class Question {
  
   public static void main(String arg[]) {
       String name;
       Scanner sc = new Scanner(System.in);
       int num,max,min,count=0;
       double num1,num2;
       double ans,result;
       String str ="";
       System.out.print("Enter your name : ");
       name = sc.nextLine();
      
       System.out.println("Enter \"A\" for Addition, \"S\" for Subtraction, \"M\" for Multiplication, \"D\" for Division: M");
       System.out.print("Enter : ");
       char ch = sc.next().charAt(0); // input choice for operation
       System.out.print("Enter the number of problems you wish to work : ");
       num = sc.nextInt();
       System.out.println("What are the low and high numbers you want in your problems?");
       System.out.print("Enter the low value for your problems : ");
       min = sc.nextInt();
       System.out.print("Enter the high value for your problems : ");
       max = sc.nextInt();
       long startTime = System.nanoTime(); // start session for questions
       if(ch == 'A')
       {
           str = "Addition";
           for(int i=0;i<num;i++)
           {
               num1 = (int)(Math.random() * (max - min + 1) + min);
               num2 = (int)(Math.random() * (max - min + 1) + min);
              
               System.out.print((int)num1 +" + "+ (int)num2 +" = ");
               ans = sc.nextDouble();
               if(ans == (num1+num2))
               {
                   count++;
                   System.out.println("Correct");
               }
               else
               {
                   System.out.println("Incorrect");
               }
           }
          
       }
       else if(ch == 'S')
       {
           str = "Subtraction";
           for(int i=0;i<num;i++)
           {
               num1 = (int)(Math.random() * (max - min + 1) + min);
               num2 = (int)(Math.random() * (max - min + 1) + min);
              
               System.out.print((int)num1 +" - "+ (int)num2 +" = ");
               ans = sc.nextDouble();
               if(ans == (num1-num2))
               {
                   count++;
                   System.out.println("Correct");
               }
               else
               {
                   System.out.println("Incorrect");
               }
           }
       }
       else if(ch == 'M')
       {
           str = "Multipication";
           for(int i=0;i<num;i++)
           {
               num1 = (int)(Math.random() * (max - min + 1) + min);
               num2 = (int)(Math.random() * (max - min + 1) + min);
              
               System.out.print((int)num1 +" * "+ (int)num2 +" = ");
               ans = sc.nextDouble();
               if(ans == (num1*num2))
               {
                   count++;
                   System.out.println("Correct");
               }
               else
               {
                   System.out.println("Incorrect");
               }
           }
       }
       else if(ch == 'D')
       {
           str = "Division";
           for(int i=0;i<num;i++)
           {
               num1 = (int)(Math.random() * (max - min + 1) + min);
               num2 = (int)(Math.random() * (max - min + 1) + min);
              
               System.out.print((int)num1 +" / "+ (int)num2 +" = ");
               ans = sc.nextDouble();
              
               result = (num1/num2);
               double result1 = Math.round(result*1000.0)/1000.0;
               if(ans == result1 )
               {
                   count++;
                   System.out.println("Correct "+result1);
               }
               else
               {
                   System.out.println("Incorrect "+result1);
               }
           }
       }
       else
       {
           System.out.println("Wrong Input !");
       }
      
       long endTime = System.nanoTime(); // sessio end for question
      
       System.out.println("");
       System.out.println("Session Summary : ");
       System.out.println(num+" problems,"+count+" correct");
       double avg = (count*1.0/num*1.0)*100;
      
      
      
       long totalTime = endTime - startTime; // calculate time in nanoseconds
       long seconds = TimeUnit.NANOSECONDS.toSeconds(totalTime); // convert time nanoseconds to seconds
      
       System.out.println("Score is "+(Math.round(avg)) +", Time is : "+seconds+" seconds");
       DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); // date
       LocalDateTime now = LocalDateTime.now(); // local time
       System.out.println("Session for "+name+" was "+str+" on "+dtf.format(now));
   }
}

In: Computer Science

QUESTION 1 The half-life for a reaction that is first-order in A is 15 minutes. How...

QUESTION 1

The half-life for a reaction that is first-order in A is 15 minutes. How long will it take for the concentration of A to change from 0.16 M to 0.040 M?

A(g) →   B(g) + C(g)

60 min

45 min

30 min

23 min

15 min

4 points   

QUESTION 2

When a 0.100 mol of a pure compound is dissolved in 1.0 L of water, the solution pH changes from 7.00 to 4.24. Which of the following is most likely the identity of the substance?

A strong acid

A strong base

A weak acid

A weak base

A neutral salt

4 points   

QUESTION 3

Which of the following will NOT change if the temperature of a reaction system is changed?

Frequency of molecular collisions

Average kinetic energy of reactant molecules

Reaction rate

Rate constant

Activation energy

4 points   

QUESTION 4

Which of the following best describes any reaction system where Q < Kc?

The system will never be able to reach a state of equilibrium.

The system is at equilibrium, and there are more products than reactants at equilibrium.

The system is at equilibrium, and there are more reactants than products at equilibrium.

The system is not at equilibrium, and the reaction will go in the reverse direction.

The system is not at equilibrium, and the reaction will go in the forward direction.

4 points   

QUESTION 5

What is the equilibrium constant expression for Kc for the following heterogeneous equilibrium?

Ni(CO)4(g) <----> Ni(s) + 4CO(g)

4 points   

QUESTION 6

Which of the following occurs when the temperature of a contained gas is reduced at constant volume?

Pressure decreases

Average molecular velocity decreases

Average kinetic energy decreases

Collision frequency decreases

All of these

4 points   

QUESTION 7

Given a fixed amount of an ideal gas held at constant pressure, calculate the volume it would occupy if a 2.00 L sample were cooled from 60.0°C to 30.0°C.

1.00 L

4.00 L

0.20 L

1.82 L

0.455 L

4 points   

QUESTION 8

Which of the following properties of liquids generally is lower for substances with stronger intermolecular forces?

Viscosity

Vapor pressure

Boiling point

Both viscosity and vapor pressure

All of these

4 points   

QUESTION 9

Use the initial concentration and initial rate data in the table to determine the rate law for the reaction:  
A(aq) + B(aq)   →   C(aq) + D(g)

Experiment #

[A] (M)

[B] (M)

Initial Rate (M/s)

1

0.400

0.400

9.00×10-3

2

0.200

0.400

4.50×10-3

3

0.200

0.200

1.13×10-3

Rate = k[A]

Rate = k[B]2

Rate = k[B]

Rate = k[A]2[B]

Rate = k[A][B]2

4 points   

QUESTION 10

If the hydronium ion concentration, [H3O+], in a solution is 5.6×10−10M, what is the hydroxide ion concentration, [OH], and the pH of the solution?

[OH] = 1.8×109 M, pH = 4.75

[OH] = 5.6×10−10M, pH = 10.56

[OH] = 1.0×10−7M, pH = 5.60

[OH] = 4.4×10−4M, pH = 9.25

[OH] = 1.8×10−5M, pH = 9.25

4 points   

QUESTION 11

Which of the following gases has the lowest average molecular velocity at the same temperature?

Ne

Xe

N2

F2

All of these have the same average molecular velocity.

4 points   

QUESTION 12

In the following 2-step mechanism, which is the catalyst?

Step 1:   A + B  → C + D
Step 2:   B + C   → X + A

A

B

C

D

X

4 points   

QUESTION 13

Which of the following substances has hydrogen bonding when in the pure liquid state?

CH3-O-CH3

NF3

CH3OH

HBr

All of these have hydrogen bonding in the pure liquid state.

4 points   

QUESTION 14

Consider the following endothermic reaction at equilibrium in a 1-liter container:

2Cl2(g) + 2H2O(g) <----> 4HCl(g) + O2(g)           ΔH > 0

Which of the following will cause a decrease in the equilibrium concentration of O2?

Increasing the temperature

Adding Cl2 gas

Adding HCl gas

Adding O2

Increasing the volume of the container

4 points   

QUESTION 15

Consider the following exothermic reaction at a state of equilibrium: C(s) + O2(g) <----> CO2(g) . Which of the following changes will cause value of the equilibrium constant Kc to change?

Increasing the container volume

Increasing the temperature

Removing O2

Adding solid carbon

All of these

4 points   

QUESTION 16

Which of the following increases the solubility of a gas in solution?

Increasing gas pressure and increasing temperature

Increasing gas pressure and decreasing temperature

Decreasing gas pressure and increasing temperature

Decreasing gas pressure and decreasing temperature

Adding more water

4 points   

QUESTION 17

When comparing a 1 m NaCl solution to that of pure water:

The 1 m NaCl solution has a higher boiling point and the higher freezing point.

The 1 m NaCl solution has a higher boiling point and a lower freezing point.

The 1 m NaCl solution has a lower boiling point and a higher freezing point.

The 1 m NaCl solution has a lower boiling point and a lower freezing point.

They both have the same boiling point and freezing point.

4 points   

QUESTION 18

Which of the following types of solids have relatively low melting points, because melting these solids requires breaking intermolecular forces, not real bonds?

Molecular solids

Ionic solids

Covalent-network solids

Metallic solids

Semiconductors

4 points   

QUESTION 19

Which of the following does NOT describe semiconductors?

Their band gaps are between metals and insulators.

Doped p-type and n-type semiconductors are less conductive than semiconductor materials that are not doped.

Their band gaps increase as particle size decreases in the 1-10 nm range.

They can be a single element or a compound.

They usually have an average number of 4 valence electrons per atom.

4 points   

QUESTION 20

If the average rate of appearance of NH3 in the following reaction is 1.40 M/s, what is the average rate of disappearance of H2 during the same time period?

N2(g) + 3H2(g)   2NH3(g)

5.40 M/s

2.80 M/s

1.20 M/s

0.700 M/s

2.10 M/s

4 points   

QUESTION 21

Which of the following should be the most soluble in benzene, C6H6?

CH3OH

H2O2

CCl4

HF

CH3NH2

4 points   

QUESTION 22

Which of the following best explains the relative boiling points for Cl2 and HCl?

Cl2 has the higher boiling point because liquid Cl2 has stronger London-dispersion forces than liquid HCl.

Cl2 has the higher boiling point because liquid Cl2 has stronger dipole-dipole forces than liquid HCl.

HCl has the higher boiling point because liquid HCl has hydrogen-bonding interactions while liquid Cl2
has no hydrogen bonding interactions.

HCl has the higher boiling point because liquid HCl has dipole-dipole forces while liquid Cl2 does not have dipole-dipole forces.

4 points   

QUESTION 23

What is the density (g/L) of H2 gas at a temperature of 283 K and 0.500 atm? (Hint: One approach is to assume a sample size of 1.0 L.)

0.0107 g/L

0.0217 g/L

0.0434 g/L

93.7 g/L

0.0899 g/L

4 points   

QUESTION 24

Given that the molar volume of Ne gas is 22.414 L/mol at STP (1.00 atm of pressure and at a temperature of 273.15 K), predict the volume of H2
gas when the number of moles is 2.50 mol under the same conditions of temperature and pressure.

2.24 L

56.0 L

0.110 L

5.60 L

11.1 L

4 points   

QUESTION 25

Which of the following best describes a chemical reaction in a state of equilibrium?

Reactant molecules are forming products as fast as product molecules are reacting to form reactants.

The rate constants of the forward and reverse reactions (kf and kr) are equal.

The value of the equilibrium constant, Kc, is 1.

The limiting reagent has been consumed.

All chemical reactions have stopped.

In: Chemistry