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

Another question on Business

question
Business, 22.06.2019 17:00
Jillian wants to plan her finances because she wants to create and maintain her tax and credit history. she also wants to chart out all of her financial transactions for the past federal fiscal year. what duration should jillian consider to calculate her finances? from (march or january )to (december or april)?
Answers: 1
question
Business, 22.06.2019 17:30
Communication comes in various forms. which of the following is considered an old form of communication? a) e-mail b) letter c) skype d) texting
Answers: 2
question
Business, 22.06.2019 20:50
You are bearish on telecom and decide to sell short 100 shares at the current market price of $50 per share. a. how much in cash or securities must you put into your brokerage account if the broker’s initial margin requirement is 50% of the value of the short position? b. how high can the price of the stock go before you get a margin call if the maintenance margin is 30% of the value of the short position? (input the amount as a positive value. round your answer to 2 decimal places.)
Answers: 3
question
Business, 22.06.2019 21:10
In transportation model analysis, the stepping-stone method is used to: a. obtain an initial feasible solutionb. evaluate empty cells for possible degeneracyc. evaluate empty cells for potential solution improvementsd. identify a dummy origin pointe. balance supply and demand
Answers: 1
You know the right answer?
Objective:
In this assignment, you will be using loops to calculate the time it takes to ferr...
Questions
question
Mathematics, 25.09.2020 08:01
question
Arts, 25.09.2020 08:01
question
Mathematics, 25.09.2020 08:01
Questions on the website: 13722367