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 21:30
Part i a company's cereal is not selling well. create a 10-15-question survey that measures customers' preferences for the company's cereal product. then, answer the following questions: how many scale items will you put in the survey? justify your answer. will you use multiple-choice questions? why or why not? how many scale points will you use in the survey? justify your answer. what data type will be used in the survey? justify your answer. part ii as a second part of this assignment, create a set of survey questions, assuming that you sell cars. you are attempting to measure how customers perceive the quality of the cars that you sell. create three survey questions with simple category scales. justify why you selected those questions and scales. create three survey questions with multiple-choice, single-response scales. justify why you selected those questions and scales. create three survey questions with multiple-choice, multiple-response scales. justify why you selected those questions and scales. create three survey questions with likert scale summated ratings. justify why you selected those questions and scales.
Answers: 1
question
Business, 22.06.2019 02:20
Archangel manufacturing calculated a predetermined overhead allocation rate at the beginning of the year based on a percentage of direct labor costs. the production details for the year are given below. calculate the manufacturing overhead allocation rate for the year based on the above data. (round your final answer to two decimal places.) a) 42.42% b) 257.14% c) 235.71% d) 1, 206.90% archangel production details.
Answers: 3
question
Business, 22.06.2019 10:00
Your father offers you a choice of $120,000 in 11 years or $48,500 today. use appendix b as an approximate answer, but calculate your final answer using the formula and financial calculator methods. a-1. if money is discounted at 11 percent, what is the present value of the $120,000?
Answers: 3
question
Business, 22.06.2019 11:50
The following are the current month's balances for abc financial services, inc. before preparing the trial balance. accounts payable $ 10,000 revenue 6,000 cash 3,000 expenses 17,500 furniture 10,000 accounts receivable 14,000 common stock ? notes payable 6,500 what amount should be shown for common stock on the trial balance? a. $48.000b. $12.500c. $27.000d. $28.000
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
Social Studies, 04.12.2020 06:00
question
English, 04.12.2020 06:00
question
Mathematics, 04.12.2020 06:00
question
Mathematics, 04.12.2020 06:00
question
Mathematics, 04.12.2020 06:00
question
Mathematics, 04.12.2020 06:00
Questions on the website: 13722361