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:20, jesus3426
According to the u. s. census bureau (), the median household income in the united states was $23,618 in 1985, $34,076 in 1995, $46,326 in 2005, and $57,230 in 2015. in purchasing power terms, how did family income compare in each of those four years? you will need to know that the cpi (multiplied by 100, 1982–1984 = 100) was 107.6 in 1985, 152.4 in 1995, 195.3 in 2005, and 237.0 in 2015
Answers: 3
image
Business, 22.06.2019 12:50, axelsanchez7710
You are working on a bid to build two city parks a year for the next three years. this project requires the purchase of $249,000 of equipment that will be depreciated using straight-line depreciation to a zero book value over the three-year project life. ignore bonus depreciation. the equipment can be sold at the end of the project for $115,000. you will also need $18.000 in net working capital for the duration of the project. the fixed costs will be $37000 a year and the variable costs will be $148,000 per park. your required rate of return is 14 percent and your tax rate is 21 percent. what is the minimal amount you should bid per park? (round your answer to the nearest $100) (a) $214,300 (b) $214,100 (c) $212,500 (d) $208,200 (e) $208,400
Answers: 3
image
Business, 22.06.2019 15:30, bhadd2001
Susan is a 5th grade teacher and loves getting up every day and going to work to teach her students. this is an example of a. extrinsic value b. interests c. intrinsic value d. external value
Answers: 2
image
Business, 22.06.2019 20:20, wavymoney77yt
Direct materials (4.2 x $15) $ 63direct labor ($12 x 17.5) $210manufacturing overhead ($2.40 x 17.5) $42total job cost $ 315dougan, inc. allocates overhead based on a predetermined overhead rate of $2.40 per direct labor hour. employees are paid $12.00 per hour. job 24 requires 4.2 pounds of direct materials at a cost of $15.00 per pound. employees worked a total of 17.5 hours to complete the job. actual manufacturing overhead costs totaled $80,000 for the year for the company. how much is the cost of job 24?
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 in other subjects:

Konu
English, 11.05.2021 14:00
Konu
Chemistry, 11.05.2021 14:00
Konu
Spanish, 11.05.2021 14:00
Konu
Advanced Placement (AP), 11.05.2021 14:00