Problem #2: Going to the Fair Assignment Goals: understanding
problem requirements, logical thinking, if-elif-else, and logical
operators.
Suppose the Great Frederick Fair wants to update its ticketing
software. They need you to write a program to handle the price
calculations, using the rules*:
• The basic price of a ticket is $40. • Senior citizens (age >=
65) get a 50% discount. • Children under 6 are free. • For
residents of Frederick County, the basic price is $35; the same
discounts still apply.
So the possible ticket prices are $0, $17.50, $20, $35, and $40.
Your program should request age and county name from the user. The
age will be entered as an integer and the county name as a
string.
Before calculating the price, confirm that the user's age is valid
– not negative and not more than 110. If it is not, give a message
and do not do the calculation. Also, the county name should not be
case sensitive – for example, Frederick, frederick, and FREDERICK
should all be acceptable.
Test your program with a variety of ages and counties to be sure
you have considered all the conditions. Here are some samples to
use.
Test run # County Age 1 Frederick 12 2 Frederick 72 3 Carroll 2 4
Howard 65 5 Washington 0 6 Frederick 5 7 Montgomery 6 8 Carroll 35
9 Frederick -15 10 Frederick 44 11 Howard 112 12 Cecil 13
Your program should be written with the future in mind. The Great
Frederick Fair might need to raise the basic prices or modify the
discounts in the future. (Hint: named constants, not hard-coded
literals!)
*These aren’t the real prices. The real system is much more
complicated. My favorite among the real ones is the Carload Special
Tuesday - $60 for everyone legally buckled in a vehicle, buses NOT
included.
In: Computer Science
|
Dinklage Corp. has 5 million shares of common stock outstanding. The current share price is $77, and the book value per share is $8. The company also has two bond issues outstanding. The first bond issue has a face value of $60 million, a coupon rate of 6 percent, and sells for 97 percent of par. The second issue has a face value of $30 million, a coupon rate of 7 percent, and sells for 105 percent of par. The first issue matures in 21 years, the second in 4 years. |
|
Suppose the most recent dividend was $4.90 and the dividend growth rate is 6 percent. Assume that the overall cost of debt is the weighted average of that implied by the two outstanding debt issues. Both bonds make semiannual payments. The tax rate is 40 percent. What is the company’s WACC? (Do not round intermediate calculations. Enter your answer as a percent rounded to 2 decimal places, e.g., 32.16.) |
| WACC ? |
In: Finance
C++
Objective
To wrap up this week, we will be looking at the Call by Value
mechanism, and how it differs from Call by Reference; whether it is
how they work in memory or how they help you accomplish a practical
task, knowing the differences between these two mechanisms is
important foundational knowledge.
**You should have one main function + 4 other functions for your submission for this lab. you have no need for extra functions beyond that, and you should not have less. You may use any pre existing functions already defined in class or a previous lab.
-Write a function storeTotal(,) that takes two arguments of type double, and has a return type of type Boolean. This function will take the number 256 and divide it by the second parameter, and add the result to the first parameter. It will return true afterwards.
-You should be making mindful decisions of which parameters should be call by value and which should be call by reference.
-If dividing by the second parameter would result in a run time error, the program does not do the calculation, and instead returns false.
-Ask the user to input two numbers, one at a time, discarding excess input each time.
-The program should keep looping until the user enters valid input.
-Once the user enters input, call function storeTotal appropriately.
-Whether storeTotal runs successfully (returns true) or not (returns false), display an appropriate message.
-Output the results of the variable that is cumulating value. This number is ALWAYS displayed in scientific notation, accurate to 3 decimal places
Repeat this 2 times.
Sample Output
How much do you already have? A
Invalid Input!
How much do you already have? Bck
Invalid Input!
How much do you already have? 42.4
What is the split factor? ,!
Invalid Input!
What is the split factor? 3.5
You now have 1.155e+002
How much do you already have? 35.6
What is the split factor? 0
That didn't go well, you still have 3.560e+001
*Explanation* 256/3.5 and then added to 42.4 gives 115.54, which, in scientific notation, gives the output above.
*Note* How scientific notation is displayed can vary from compiler to compiler, as long as you are getting it done through proper knowledge of C++ then the output does not need to look exactly the same.
In: Computer Science
(6) Moons of Mars.
In 1727, Jonathan Swift wrote Gulliver's Travels in which
he described two moons orbiting Mars. About 150 years later, the
American astronomer Asaph Hall used a large telescope to discover
two moons of Mars and they were named Phobos ("fear") and Diemos
("terror"). Their motions were surprisingly close to Jonathan
Swift's description. The orbital period of Phobos is 8 hours and
that of Diemos about 30 hours.
(2 pts.) (a) Using the information given above and one of Kepler's laws (which one?), explain which moon, Phobos or Diemos, is farther from Mars.
(2 pts.) (b) Describe the motions of Phobos and Diemos as seen by an inhabitant of Mars at, say, 40° north martian latitude.
(Note: Phobos and Diemos both orbit Mars close to Mars' equatorial plane and in the same (counterclockwise) direction that Mars spins. Mars' spin period is close to 24 hours. Drawing diagrams would probably help).
PLEASE EXPLAIN YOUR ANSWERS CLEARLY
In: Physics
Twenty laboratory mice were randomly divided into two groups of 10. Each group was fed according to a prescribed diet. At the end of 3 weeks, the weight gained by each animal was recorded. Do the data in the following table justify the conclusion that the mean weight gained on diet B was greater than the mean weight gained on diet A, at the α = 0.05 level of significance? Assume normality. (Use Diet B - Diet A.) Diet A 5 8 10 6 6 10 13 8 5 9 Diet B 9 10 7 23 12 15 13 7 17 12 (a) Find t. (Give your answer correct to two decimal places.) (ii) Find the p-value
In: Statistics and Probability
Steve Douglas has been hired as a management trainee by a large brokerage firm. As his first project, he is asked to study the gross profit of firms in the chemical industry. What factors affect profitability in that industry? Steve selects a random sample of 16 firms and obtains data on the number of employees, number of consecutive common stock dividends paid, the total value of inventory at the start of the current year, the gross profit for each firm and foreign owner . His findings are as follows:
|
C o m p a n y |
Gross Profit ($000), y |
Number of Employees , x1 |
Consecutive Dividends, x2 |
Beginning Inventory ($000 ), x3 |
Foreign owner, x4 |
|
1 |
$2800 |
140 |
12 |
$1800 |
Yes |
|
2 |
1300 |
65 |
21 |
320 |
Yes |
|
3 |
1230 |
130 |
42 |
820 |
No |
|
4 |
1600 |
115 |
80 |
76 |
No |
|
5 |
4500 |
390 |
120 |
3600 |
Yes |
|
6 |
5700 |
670 |
64 |
8400 |
Yes |
|
7 |
3150 |
205 |
43 |
508 |
Yes |
|
8 |
640 |
40 |
14 |
870 |
Yes |
|
9 |
3400 |
480 |
88 |
5500 |
No |
|
10 |
6700 |
810 |
98 |
9875 |
No |
|
11 |
3700 |
120 |
44 |
6500 |
No |
|
12 |
6440 |
590 |
110 |
9130 |
No |
|
13 |
1280 |
440 |
38 |
1200 |
No |
|
14 |
4160 |
280 |
24 |
890 |
No |
|
15 |
3870 |
650 |
60 |
1200 |
Yes |
16 980 150 24 1300 No
C. Determine the regression equation. The Master Chemical Company employs 220 people, has paid 64 consecutive common stock dividends, has an inventory valued at $1 500 000 at the start of the year and foreign owner. What is the estimate of the gross profit?
D.Conduct a global test of hypothesis to determine whether any of the regression coefficients differ from zero. Test at a significance level of 0.05.
E. Conduct a test of hypothesis for the individual regression coefficients. Would you consider deleting any of the independent variables? Test at a significance level of 0.05.
F. If your conclusion in part (c) was to delete one or more independent variables, run the regression equation again, deleting those variables.
Provide step by step solution on excel.
In: Statistics and Probability
Fill in the missing numbers from some slightly modified recent Financial Statements. If I list an account area, that account areas is correct.
Deferred income taxes (current asset) 5,
Total current liabilities 93,
Total current assets 101,
Deferred revenue (Current liability) 10,
Long-term investments 4,
Short-term investments 4,
Total liabilities 218,
Other current assets 3,
Short-term borrowings 21,
Total assets 318,
Accounts payable 49,
Gross margin 195,
Preferred stock ($5 par) 12,
Merchandise inventory 76,
Deferred income taxes (Long term liability) 2,
Current maturities of long-term debt 5,
Other Long Term Assets 13,
Net earnings 27,
Capital in excess of par value 4,
Retained earnings 76,
Accumulated other comprehensive loss (Equity) -2,
Cost of sales 366,
Dividends 8,
Other Long Term liabilities 8,
Pre-tax earnings 43,
Selling, general and administrative 132,
EBIT 48,
Deferred revenue – long-term protection plans (Long term Liability) 7,
Addition to Retained Earnings ________, Total liabilities and shareholders' equity ________, Cash and cash equivalents _______ , Income tax provision ________, Net sales _________ , Long-term debt ________, Common stock ($.50 par) __________ , Interest Expense – net ________, Depreciation ________ , Accrued compensation ________, Property, less accumulated depreciation _______ .
ANSWER OPTIONS (MATCH LETTERS AND NUMBERS):
|
|
In: Accounting
A study compared weight loss between patients on diet A and patients on diet B. Let
mu 1μ1
represent the mean of number of pounds patients on diet A lose in six months and
mu 2μ2
represent the mean of number of pounds patients on diet B lose in six months. Complete parts (a) through
(d).
a. State the null and alternative hypotheses if you want to test whether the mean weight loss between the two diets is equal. What are the null and alternative hypotheses?
A.
Upper H 0H0:
mu 1 equals mu 2μ1=μ2
Upper H 1H1:
mu 1 not equals mu 2μ1≠μ2
B.
Upper H 0H0:
mu 1μ1less than or equals≤mu 2μ2
Upper H 1H1:
mu 1μ1greater than>mu 2μ2
C.
Upper H 0H0:
mu 1μ1greater than or equals≥mu 2μ2
Upper H 1H1:
mu 1μ1less than<mu 2μ2
D.
Upper H 0H0:
mu 1 not equals mu 2μ1≠μ2
Upper H 1H1:
mu 1 equals mu 2μ1=μ2
b. In the context of this study, what is the meaning of a Type I error?
A.
A Type I error is committed when the null hypothesis is rejected when there is a significant difference in the mean weight loss between the two diets.
B.
A Type I error is committed when one concludes that there is a significant difference in mean weight loss between the two diets when there is not a significant difference.
C.
A Type I error is committed when one rejects both the null and alternative hypotheses.
D.
A Type I error is committed when one concludes that there is not a significant difference in mean weight loss between the two diets when there is a significant difference.
c. In the context of this study, what is the meaning of a Type II error?
A.
A Type II error is committed when one does not reject both the null and the alternative hypothesis.
B.
A Type II error is committed when one concludes that there is not a significant difference in mean weight loss of only diet A.
C.
A Type II error is committed when one concludes that there is not a significant difference in mean weight loss between the two diets when there is indeed a significant difference.
D.
A Type II error is committed when one concludes that there is a significant difference in mean weight loss between the two diets when there is not a significant difference.
d. Suppose that a sample of
108108
patients on diet A lost a mean of
7.37.3
pounds in six months, with a sample standard deviation of
3.83.8
pounds, whereas a sample of
108108
patients on diet B lost a mean of
7.47.4
pounds in six months, with a standard deviation of
2.52.5
pounds. Assume the population variances are equal. Using a
0.050.05
level of significance, is there evidence of a difference in the mean weight loss of patients between the two diets?
▼
Do not reject
Reject
H0.
There
▼
is insufficient evidence
is evidence
of a difference in the mean weight loss of patients between the two diets.
In: Statistics and Probability
A researcher working for an insurance company that sells life insurance would like to use regression analysis to predict life expectancy of his clients. He knows that there are several factors that contribute to life expectancy: some are genetic, some are related to life style, some are related to biological factors, and some are related to environment (access to health care, cleanliness of air, etc.) . He selects these candidate variables to develop his regression equation: gender, number of cigarettes smoked per day, cholesterol level, systolic blood pressure, and height-to-weight index: (actual weight / appropriate weight given gender, build, and height) * 100. Use the datasheet life expectancy in datasetsRM.xls to develop a regression equation to predict how long a person should live (for gender: 0=female, 1=male): 1. First, plot each non-categorical predictor variable against the dependent variable (age of death) and examine the plot to see if the relationship is linear. What’s your assessment? 2. Perform a multiple regression analysis and write up the results of your regression analysis in APA style. 3. For a male who does not smoke cigarettes at all, has a systolic blood pressure of 130, a height-to-weight index of 110, and a cholesterol level of 200, what is his life expectancy? NumCigsDay WtHtIndex Gender Cholesterol BloodPres AgeOfDeath 0 98 0 179 120 90 0 90 0 186 100 98 0 140 0 190 130 90 3 96 0 191 120 87 0 120 0 200 120 90 0 100 0 187 120 94 0 130 0 190 110 96 4 92 0 191 110 83 5 110 0 200 110 79 5 193 0 210 120 79 10 107 0 215 130 77 0 117 0 227 140 80 0 128 0 240 130 99 15 179 0 230 150 68 10 150 0 240 160 70 5 100 0 245 120 79 8 112 0 260 130 76 10 150 0 275 140 67 8 121 0 280 130 72 0 90 1 210 120 85 0 100 1 187 100 94 0 130 1 179 130 88 10 92 1 183 120 72 0 119 1 184 120 89 0 110 1 189 120 80 2 120 1 192 110 87 6 100 1 196 110 69 4 140 1 204 110 73 10 128 1 215 120 65 0 107 1 216 140 85 0 98 1 219 130 75 8 119 1 220 140 68 3 117 1 222 130 89 11 193 1 232 150 62 12 179 1 245 160 66 8 150 1 246 120 78 12 96 1 261 130 67 0 121 1 269 130 70 8 112 1 279 140 64 0 150 1 280 130 74
In: Math
A study wants to look at the correlation between sugar consumption and the development of cavities.
The table below shows the average daily intake of sugar (g) and the total number of cavities per patient over the one-year study period.
Daily Sugar Intake / Number of Cavities
(X) (Y)
30 2
40 3
150 3
90 0
75 1
25 1
110 4
4. What is the sample correlation coefficient given Σ(??−?̅)27?=1=12821.4, Σ(??−?̅)27?=1=12, and Σ(?−?̅)(?−?̅)=130? a. 0.33 b. 0.70 c. 0.87 d. -0.45
5. What type of correlation does this represent? a. Strong positive b. Strong inverse c. Weak positive d. Weak inverse
The investigator wants to construct a regression equation based on his current sample to be able to predict the number of cavities that a patient develops based only on their sugar intake given the standard deviation for the daily sugar intake is 43.25 and the standard deviation for the number of cavities is 1.41.
6. What is the slope of the line (i.e. what is b1)? a. 0.87 b. 0.01 c. 1.41 d. 0.50
7. What is the y-intercept (i.e. what is b0)? a. 1.26 b. 0.50 c. 0.01 d. 1.15
8. What is the predicted number of cavities for someone who consumes on average 45 grams of sugar a day? a. 1.71 b. 1.55 c. 0.67 d. 1.10
In: Statistics and Probability