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, 21.06.2019 18:40
Alyssa works for an engineering firm that has been hired to design and supervise the construction of a highway bridge over a major river. the bridge will be a unique design, incorporating complex designs that will likely never be duplicated. how should alyssa deal with designing and overseeing the building of the bridge?
Answers: 3
question
Business, 22.06.2019 14:00
Wallace company provides the following data for next year: month budgeted sales january $120,000 february 108,000 march 140,000 april 147,000 the gross profit rate is 35% of sales. inventory at the end of december is $29,600 and target ending inventory levels are 10% of next month's sales, stated at cost. what is the amount of purchases budgeted for january?
Answers: 1
question
Business, 22.06.2019 18:30
What is the relationship between credit and debt?
Answers: 1
question
Business, 22.06.2019 21:10
Which of the following statements is (are) true? i. free entry to a perfectly competitive industry results in the industry's firms earning zero economic profit in the long run, except for the most efficient producers, who may earn economic rent. ii. in a perfectly competitive market, long-run equilibrium is characterized by lmc < p < latc. iii. if a competitive industry is in long-run equilibrium, a decrease in demand causes firms to earn negative profit because the market price will fall below average total cost.
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
question
Mathematics, 18.12.2020 04:40
question
SAT, 18.12.2020 04:40
question
Computers and Technology, 18.12.2020 04:40
question
German, 18.12.2020 04:40
Questions on the website: 13722361