Video games are rather complicated to program, not least of which because of the graphics work that needs to be completed to finish a video game. Still, even relatively simple games have historically had a chance of becoming popular (e.g. Tetris®). Since you are learning to program for the first time, let's look at a text-only game.
Write a program that has the computer generate a pseudorandom integer between -100 and +100, and ask the user to guess what the number is. To generate the pseudorandom number, research and use the randi command. If the user's guess is higher than the computer-generated pseudorandom number, print a statement to that effect. If the user's guess is lower than the computer-generated pseudorandom number, print a statement to that effect. Keep track of how many guesses it takes for the user to guess the right number, and print that information to the screen when the program terminates. Do not re-initialize the computer-generated pseudorandom number between iterations, otherwise the user will have a hard time trying to guess the computer-generated pseudorandom number.
Validate the user's input; if the user enters a number greater than 100 or less than -100, prompt the user to enter a number within the guess range. Do not count guesses out of range (i.e. greater than 100 or less than -100) as an iteration. Do not concern yourself with testing if the user entered non-numeric input, and assume that the user will enter an integer value. If the user enters the value inf, terminate the program (though count that iteration as a valid iteration for the purposes of seeing how many times the program iterated).
Use no more than two while loops to solve this problem, and emulate the output format in these two sample runs:
Sample Run #1 (with a computer-generated value of 9):
Enter your guess:
8
Sorry, your guess was too low. Please try again.
Enter your guess:
10
Sorry, your guess was too high. Please try again.
Enter your guess: 9
You guessed the correct value!
The correct value was
9.
The program iterated 3 times.
Sample Run #2 (with a computer-generated value of -3):
Enter your guess:
100
Sorry, your guess was too high. Please try again.
Enter your guess:
-100
Sorry, your guess was too low. Please try again.
Enter your guess: inf
You asked to terminate the program.
The correct value was
-3.
The program iterated 3 times.
In: Computer Science
In: Nursing
Need IN JAVA
Please DO NOT COPY AND PASTE old solutions
WILL UPVOTE
The Babysitters Club Employment Agency has decided to computerize their payroll. A babysitter earns a specific fee per hour until 9:00 PM (while the children are awake and active), a lower rate between 9:00 PM and midnight (after bedtimes and the babysitter can study), and a higher fee after midnight (when babysitting cuts into prime sleeping time).
They maintain two datafiles are one for the employees and one for their data
Personnel data file
employee no.
lastname, firstname
street address
city, state zipcode
hourly rate before 9:00 PM hourly rate between 9:00 PM and midnight hourly rate after midnight
¼
Payroll data file
employee no.
number of days employed
starting time and ending time for each day
¼
Write a program that reads the starting time and ending times (in hours and minutes) for a babysitter and computes the babysitter’s fee. Assume all times are between 6:00 PM and 6:00 AM.
Your output should consist of an alphabetical list (by last name) of each babysitter and their pay.
Be sure to use the structured programming techniques you have learned in prior classes. Namely, use methods and maximize legibility by using proper indentation, spacing, and comments. Do not forget to provide program documentation.
The Data below is the data you should use to do the assignment
Personnel file Data
0001
McGill, Stacey
231 Maple Avenue
Stoneybrook, Connecticut 30122
5.50 4.00 6.00
0002
Spier, Maryann
401 Orange Lane
Stoneybrook, Connecticut 30122
10.00 8.00 15.00
0003
Thomas, Kristy
222 Blossom Blvd.
Stoneybrook, Connecticut 30122
5.00 4.00 6.00
0004
Schafer, Dawn
131 Apple Gardens
Stoneybrook, Connecticut 30122
4.00 3.00 5.00
0005
Pike, Mallory
656 Brook Lane
Stoneybrook, Connecticut 30122
1.75 1.00 1.25
0006
Ramsey, Jessi
545 Greenleaf Street
Stoneybrook, Connecticut 30122
10.00 10.00 10.00
0007
Kishi, Claudia
303 Ginger Blvd.
Stoneybrook, Connecticut 30122
5.00 2.50 7.50
Payroll file data
0001
2
8:00 10:00
9:00 11:30
0002
1
6:00 2:00
0003
2
8:00 10:00
9:00 11:30
0004
3
9:30 1:00
6:00 9:00
7:15 8:15
0005
2
7:00 5:30
6:00 1:45
0006
3
9:30 1:00
7:00 9:00
1:15 3:15
0007
2
7:00 3:30
9:00 1:45
In: Computer Science
Material cost = $40 per unit
Labor hours = 10 per unit for the first unit, Labor cost = $10/hour
List the material and labor cost and labor + material cost for the first 8 units when the supplier utilizes a learning curve of 85%.
PLEASE PROVIDE THE FORMULA SO I ACTUALLY KNOW HOW TO DO THIS STUFF.
|
Unit |
Material Cost |
Labor Cost |
Total Cost |
|
1 |
$40 |
||
|
2 |
$80 |
||
|
3 |
120 |
||
|
4 |
$160 |
||
|
5 |
$200 |
||
|
6 |
$240 |
||
|
7 |
$280 |
||
|
8 |
$320 |
In: Accounting
Suppose Ford Motor Company sold an issue of bonds with a 10-year maturity, a $1000 par value, a 10 percent coupon rate, and semiannual interest payments.
a) Two years after the bonds were issued, the going rate of interest on bonds such as these fell to 6 percent. At what price would the bonds sell?
b) Suppose that, two years after the initial offering, the going interest rate had risen to 12 percent. At what price would the bonds sell?
c)Suppose that conditions in part A existed - That is, interest rates fell to 6 percent two years after the issue date. Supose further that the interest rate remained at 6 percent for the next eight years. Describe what would happen to the price of Ford Motor Company bonds over time.
Please explain with detail... I'm a little bit lost in this class.
In: Finance
Klein Company distributes a high-quality bird feeder that sells for $30 per unit. Variable costs are $12 per unit, and fixed costs total $279,000 annually.
Required:
Answer the following independent questions:
1. What is the product’s CM ratio?
2. Use the CM ratio to determine the break-even point in sales dollars.
3. The company estimates that sales will increase by $63,000 during the coming year due to increased demand. By how much should operating income increase?
4. Assume that the operating results for last year were as follows:
| Sales | $ | 600,000 | |
| Variable expenses | 228,000 | ||
| Contribution margin | 372,000 | ||
| Fixed expenses | 279,000 | ||
| Operating income | $ | 93,000 | |
a. Compute the degree of operating leverage at the current level of sales.
b. The president expects sales to increase by 12% next year. By how much should operating income increase?
5-a. Refer to the original data. Assume that the company sold 30,000 units last year. The sales manager is convinced that a 12% reduction in the selling price, combined with a $67,000 increase in advertising expenditures, would cause annual sales in units to increase by 20%. Prepare two contribution format income statements, one showing the results of last year’s operations and one showing what the results of operations would be if these changes were made. (Round "Per Unit" answers to 2 decimal places.)
5-b. Would you recommend that the company do as the sales manager suggests?
multiple choice
Yes
No
6. Refer to the original data. Assume again that the company sold 30,000 units last year. The president feels that it would be unwise to change the selling price. Instead, he wants to increase the sales commission by $5 per unit. He thinks that this move, combined with some increase in advertising, would increase annual unit sales by 50%. By how much could advertising be increased with profits remaining unchanged? Do not prepare an income statement; use the incremental analysis approach.
In: Accounting
Feather Friends, Inc., distributes a high-quality wooden birdhouse that sells for $120 per unit. Variable expenses are $60.00 per unit, and fixed expenses total $180,000 per year. Required: Answer the following independent questions: 1. What is the product's CM ratio? 2. Use the CM ratio to determine the break-even point in dollar sales. 3. Due to an increase in demand, the company estimates that sales will increase by $44,000 during the next year. By how much should net operating income increase (or net loss decrease) assuming that fixed expenses do not change? 4. Assume that the operating results for last year were: Sales $ 3,120,000 Variable expenses 1,560,000 Contribution margin 1,560,000 Fixed expenses 180,000 Net operating income $ 1,380,000 a. Compute the degree of operating leverage at the current level of sales. (Round your answer to 2 decimal places.) b. The president expects sales to increase by 19% next year. By what percentage should net operating income increase? (Round intermediate calculations and final answer to 2 decimal places.) 5. Refer to the original data. Assume that the company sold 43,500 units last year. The sales manager is convinced that a 10% reduction in the selling price, combined with a $72,000 increase in advertising, would increase annual unit sales by 50%. a. Prepare two contribution format income statements, one showing the results of last year’s operations and one showing the results of operations if these changes are made. (Do not round intermediate calculations. Round your "Per unit" answers to 2 decimal places.) b. Would you recommend that the company do as the sales manager suggests? Yes No 6. Refer to the original data. Assume again that the company sold 43,500 units last year. The president does not want to change the selling price. Instead, he wants to increase the sales
In: Accounting
Construct the indicated confidence interval for the difference between population proportions p1 - p2. Assume that the samples are independent and that they have been randomly selected.
4) x1 = 44, n1 = 64 and x2 = 50, n2 = 73; Construct a 95% confidence interval for the difference 4) between population proportions p1 - p2.
In: Statistics and Probability
Assume you have completed a capital budgeting analysis of building a new plant on land you own, and the project's NPV is $100 million. You now realize that instead of building the plant, you could build a parking garage, and would generate a pre tax revenue of $15 million. The project would last 3 years, the corporate tax rate is 40%, and the WACC is 7%. What is the new NPV of the project, after incorporating the effect of the opportunity cost?
In: Finance
PLEASE FILL IN BLANK WITH CORRECT ANSWERS. THANK YOU!
CHAPTER 19: CHI-SQUARE TEST FOR QUALITATIVE DATA
Key Terms
One-way test – Evaluates whether observed frequencies for a single qualitative variable are adequately described by hypothesized or expected frequencies.
Expected frequency – The hypothesized frequency for each category, given that the null hypothesis is true.
Observed frequency – The obtained frequency for each category.
Two-way test – Evaluates whether observed frequencies reflect the independence or two qualitative variables.
Squared Cramer’s phi coefficient – Very rough estimate of the population of predictability between two qualitative variables
Text Review
You may recall from Chapter 1, that when observations are classified into categories, the data are (1)_____________________. The hypothesis test for qualitative data is known as chi-square. When the variables are classified along a single variable, the test is a one-way chi-square. The one-way chi-square test makes a statement about two or more population (2)_______________ that are reflected by expected frequencies.
If the null hypothesis is true, then except for the effects of chance, the hypothesized proportions should be reflected in the sample. The number of observations hypothesized is referred to as (3)___________ and is calculated by multiplying the expected proportion by the total sample size. If the discrepancies between the observed and expected frequencies are small enough to be attributed to chance, then the null hypothesis would be retained. But if the discrepancies between the observed and expected frequencies are large enough to qualify as a rare outcome, the null hypothesis would be (4)_________.
The value of chi-square can never be (5)______________________________ because of the squaring of each difference between observed and expected frequencies.
For the one-way chi-square test, the degrees of freedom always equal the number of (6)____________ minus one.
The chi-square test is non-directional because the squaring of the discrepancies always produces a (7)__________________ value. However, for the same reason, only the upper tail of the sampling distribution contains the rejection region.
It is possible to cross-classify observation along two qualitative variables. This is referred to as a (8)_________________________ chi-square test. For the two-way test, the null hypothesis makes a statement about the lack of relationship between the two qualitative variables. In the two-way test, words are usually used instead of symbols in the null hypothesis, and as in the one-way test, the research hypothesis simply states that the null hypothesis is false.
In the two-way test, expected frequencies are calculated by multiplying the column total times the row total and dividing by the overall total. The chi-square critical value may be found in Table D of Appendix D only if degrees of freedom are known. For the two-way test, degrees of freedom equals number of categories for the column variable minus one, times the number of categories for the row variable minus one [df = (C – 1) (R-1)].
Some precautions are necessary in using the chi-square tests. One restriction is that the chi-square test requires that observations be (9)________________________. In this case, independence means that one observation should have no influence on another. One obvious violation of independence occurs when a single subject contributes more than one pair of observations. One way to check that this requirement is not being violated is to remember that the total for all observed frequencies must never exceed the total number of subjects. Using chi-square appropriately also requires that expected frequencies not be too small. Generally, any expected frequency of less than (10)______________ is too small. Small sample sizes should also be avoided, as should unduly large sample size. A sample size that is too large produces a test that detects differences of no practical importance.
When the null hypothesis has been rejected, the researcher should consider using squared (11)______ phi coefficient to determine whether the strength of the relationship is small, medium, or large.
In: Statistics and Probability