subject
Business, 02.03.2020 20:38 MikeWrice3615

Objective:
In this assignment, you will be using loops to calculate the time it takes to ferry a herd of llamas across an arbitrarily sized body of water using three boats of various speeds and cargo capacities.
Description:
After graduating from the U of A. you find yourself as a middle-aged llama farmer. Not the career you expected, but hey, it definitely pays the bills. One day, you need to transport your enormous llama herd across a lake. Luckily, you have three boats of various speeds and cargo capacities) and a team of expert llama boat operators.
Write a program to calculate the amount of time it will take you to transport your llama herd across the lake.

Task 1:
Start your program by asking the user for
• The number of llamas in the user's herd
• The length of the lake to cross in meters
• The llama capacity of the boat!
• The speed of boat 1 in meters per second
• The llama capacity of boat 2
• The speed of boat2 in meters per second
• The llama capacity of boat 3
• The speed of boat 3 in meters per second

If any value entered by the user is negative, prompt the user to enter the value again using a while loop.

Task 2:
Now it's time to simulate! Using the values you collected from the user in Task I write a program to generate a table of the following values:
• The current time in seconds
• The position of each boat relative to the starting shore
• The number of llamas delivered

While the herd is being transported, all boats repeat the same steps:

• Collect as many llamas from the shore as possible, up to the boat's llama capacity
• Travel at top speed across the lake
• Deliver the llamas
• Travel at top speed back across the lake to collect more llama

This is repeated until the entire herd of llama has crossed the lake. (Note that if the number of llamas left to be collected from the shore is less than a collecting boat's llama capacity, all the remaining llamas are loaded onto the boat.) The position of each boat can be calculated using the equation:
new position - old position + velocity * time elapsed
Remember that boats change direction as soon as they reach the shore!
Assume that the loading and unloading of llamas is instantaneous and that the boats can turn around instantaneously. Also assume that each boat always carries its maximum number of llamas and that the speed of each boat in meters per second will never exceed the numerical value of the length of the lake in meters. At the end of the simulation, print out the total time it takes to deliver the entire llama herd in seconds.

ansver
Answers: 2

Other questions on the subject: Business

image
Business, 21.06.2019 21:30, Ayomide19
Daniel owns 100 shares of abc corporation's common stock. abc uses the fair value option, and recent declines in the firm's credit rating have caused the value of the firm's outstanding bonds payable to drop by 10%. daniel feels this is good news, but he wants to know what you think about the situation. which of the following represents your best response? a : "this situation may be positive for you in that the change in abc's credit standing indicates that the value of the firm's assets is likely increasing. however, the drop in bond value may negate any positive effects on your bottom line, because it means your claim on the firm's assets is simultaneously decreasing." b : "actually, this is bad news all around. the drop in the value of abc's bonds payable means shareholders' claims on the firm's assets have decreased. moreover, abc's declining credit rating means that the firm's assets are probably also dropping in value, thus magnifying your losses even more." c : "on the surface, this seems like good news because it means your claim on the firm's assets has increased. however, the drop in creditworthiness may also indicate that abc's assets are declining in value, thus offsetting any gains associated with the drop in bonds payable." d : "you're right! this is good news because it means that abc's debtholders have a decreased claim on the firm's assets. as a result, the firm's existing shareholders"like you"have seen their claim on the firm's assets increase."
Answers: 2
image
Business, 22.06.2019 15:30, jasonoliva13
Careers in designing, planning, managing, building and maintaining the built environment can be found in the following career cluster: a. agriculture, food & natural resources b. architecture & construction c. arts, audio-video technology & communications d. business, management & administration
Answers: 2
image
Business, 22.06.2019 23:50, bnnn
Sabrina gupta, an investment advisor with a major brokerage firm, was examining wal-mart stores, inc. (wal-mart) stock and its valuation. gupta wondered whether to recommend the stock to any of her new clients or to existing clients who did not currently have wal-mart in their portfolios. her key task was to use an intrinsic value approach to price the shares and to then compare the resulting price with the price at which the stock was traded in the market. gupta wanted to use alternative valuation methods and assumptions to produce intrinsic value estimates for wal-mart stock. she was interested in seeing if the alternative methods would point to a consensus regarding the valuation of the stock and to see if the valuations suggested an investment opportunity given the current market price. methods she contemplated to use were: multi-stage growth modelprice earnings multiplemost valuation methods gupta considered required a common set of inputs: future cash flows to wal-mart investorsgrowth rate of future cash flowsdiscount factor or required rate of return by wal-mart investorsgupta gathered data to determine each of the above. gupta thought that dividends to wal-mart shareholders would adequately capture the cash flows to wal-mart shareholders; she also thought that this approach would simplify her task and she would revisit more complex valuation models if she felt the need. gupta thought that capm would provide her a relatively reliable estimate of the required rate of return. capm based required rate of return can be estimated by using a risk free rate, systematic risk of the firm and equity market risk premium. gupta thought that in a valuation exercise that involve long term cash flows, 10-year government bond yield would be an appropriate risk free rate of return estimate. she checked the 10 year note rate and found out that it was about 3.68%. gupta searched for wal-mart beta in bloomberg. bloomberg estimates betas by regressing the s& p 500 returns on the firm returns over the past two years and arrives at a “raw” beta estimate. bloomberg makes an adjustment in raw beta based on some academic research. gupta is confident that bloomberg adjustment is justified and she uses wal-mart beta estimate of 0.66 in her analysis. while gupta is aware of the importance of emrp assumption, she thinks that bloomberg’s historical estimate of 5.05% is a safe assumption. she is aware of the fact that some studies suggest a larger risk premium of approximately six per cent, while others suggest a much lower forward-looking premium of less than four per cent. she is mindful of the arbitrariness of her assumption, and she takes a note to revisit this issue if her valuations produce unreasonable estimates. anticipated dividend growth (g) is often estimated in a variety of ways. first, observed historical dividend growth can be assumed to continue in a perpetual fashion. second, future dividend growth can be estimated on the basis of recent estimates of analysts. gupta noted that the consensus annual wal-mart dividend for fiscal year 2011 was $1.21, and one respected analyst had estimated the expected constant dividend growth (in perpetuity) at approximately 3%.as the chart suggests, both earnings and dividend growth rates are declining but they seem to be higher than the “respected analyst’s” estimates. gupta decides to use several alternative perpetual growth assumptions to see the impact on price. since gupta decided to use variants of dividend discount model (ddm), she checked the anticipated earnings for 2011. analyst’s estimates suggested $4.10 earnings per share. gupta decided to use 10% growth rate from 2011 to 2012 and assumed a steady decline to 3% in 13 years (until 2024) where the perpetual growth rate of 3% resumes. she also assumed that walmart will increase its dividend payout ratio from 30% to 55% from years 2012 to 2024. you are asked to reproduce gupta’s analysis of multi-stage growth model and double check her valuation by using an earnings multiple. you have all the data you need to conduct the multi stage discounted growth model analysis, but you will need to do some research about the multiples valuation.
Answers: 3
image
Business, 23.06.2019 00:10, riley01weaver1
Kcompany estimates that overhead costs for the next year will be $4,900,000 for indirect labor and $1,000,000 for factory utilities. the company uses direct labor hours as its overhead allocation base. if 100,000 direct labor hours are planned for this next year, what is the company's plantwide overhead rate?
Answers: 3
You know the right answer?
Objective:
In this assignment, you will be using loops to calculate the time it takes to ferr...

Questions in other subjects:

Konu
Health, 03.12.2020 19:30
Konu
SAT, 03.12.2020 19:30