In the cinema classic Die Hard With a Vengeance, Bruce Willis and Samuel L. Jackson are...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In the cinema classic Die Hard With a Vengeance, Bruce Willis and Samuel L. Jackson are presented with a difficult challenge by Jeremy Irons. They are given a 3 gallon can, a 5 gallon can, and a fountain of water. Their goal is to have exactly 4 gallons of water left in the can. For this assignment, you will recreate this harrowing game using loops. You will present the user with the following options: 1. Fill the 5 gallon can from the fountain 2. Fill the 3 gallon can from the fountain 3. Pour the 5 gallon can into the 3 gallon jug 4. Pour the 3 gallon can into the 5 gallon jug 5. Empty the 5 gallon can into the fountain 6. Empty the 3 gallon can into the fountain You should then calculate the amount of water in each can and display it to the user. Note that if the 3 gallon can is full, option # 3 should have no effect. Likewise, if the 5 gallon can ful option #4 should have no effect. The game will end when there is exactly 4 gallons of water in the 5 gallon can. Sample Output: [4 Gallons of Water] The 3 gallon can has 0 gallons of water. The 5 gallon can has 0 gallons of water. Options 1) Fill the 5 gallon can from the fountain 2) Fill the 3 gallon can from the fountain 3) Pour the 5 gallon can into the 3 gallon jug 4) Pour the 3 gallon can into the 5 gallon jug 5) Empty the 5 gallon can into the fountain 6) Empty the 3 gallon can into the fountain What will you do? 1 The 3 gallon can has 0 gallons of water. The 5 gallon can has 5 gallons of water. Options 1) Fill the 5 gallon can from the fountain 2) Fill the 3 gallon can from the fountain 3) Pour the 5 gallon can into the 3 gallon jug 4) Pour the 3 gallon can into the 5 gallon jug 5) Empty the 5 gallon can into the fountain 6) Empty the 3 gallon can into the fountain What will you do? 3 The 3 gallon can has 3 gallons of water. The 5 gallon can has 2 gallons of water. In the cinema classic Die Hard With a Vengeance, Bruce Willis and Samuel L. Jackson are presented with a difficult challenge by Jeremy Irons. They are given a 3 gallon can, a 5 gallon can, and a fountain of water. Their goal is to have exactly 4 gallons of water left in the can. For this assignment, you will recreate this harrowing game using loops. You will present the user with the following options: 1. Fill the 5 gallon can from the fountain 2. Fill the 3 gallon can from the fountain 3. Pour the 5 gallon can into the 3 gallon jug 4. Pour the 3 gallon can into the 5 gallon jug 5. Empty the 5 gallon can into the fountain 6. Empty the 3 gallon can into the fountain You should then calculate the amount of water in each can and display it to the user. Note that if the 3 gallon can is full, option # 3 should have no effect. Likewise, if the 5 gallon can ful option #4 should have no effect. The game will end when there is exactly 4 gallons of water in the 5 gallon can. Sample Output: [4 Gallons of Water] The 3 gallon can has 0 gallons of water. The 5 gallon can has 0 gallons of water. Options 1) Fill the 5 gallon can from the fountain 2) Fill the 3 gallon can from the fountain 3) Pour the 5 gallon can into the 3 gallon jug 4) Pour the 3 gallon can into the 5 gallon jug 5) Empty the 5 gallon can into the fountain 6) Empty the 3 gallon can into the fountain What will you do? 1 The 3 gallon can has 0 gallons of water. The 5 gallon can has 5 gallons of water. Options 1) Fill the 5 gallon can from the fountain 2) Fill the 3 gallon can from the fountain 3) Pour the 5 gallon can into the 3 gallon jug 4) Pour the 3 gallon can into the 5 gallon jug 5) Empty the 5 gallon can into the fountain 6) Empty the 3 gallon can into the fountain What will you do? 3 The 3 gallon can has 3 gallons of water. The 5 gallon can has 2 gallons of water. In the cinema classic Die Hard With a Vengeance, Bruce Willis and Samuel L. Jackson are presented with a difficult challenge by Jeremy Irons. They are given a 3 gallon can, a 5 gallon can, and a fountain of water. Their goal is to have exactly 4 gallons of water left in the can. For this assignment, you will recreate this harrowing game using loops. You will present the user with the following options: 1. Fill the 5 gallon can from the fountain 2. Fill the 3 gallon can from the fountain 3. Pour the 5 gallon can into the 3 gallon jug 4. Pour the 3 gallon can into the 5 gallon jug 5. Empty the 5 gallon can into the fountain 6. Empty the 3 gallon can into the fountain You should then calculate the amount of water in each can and display it to the user. Note that if the 3 gallon can is full, option # 3 should have no effect. Likewise, if the 5 gallon can ful option #4 should have no effect. The game will end when there is exactly 4 gallons of water in the 5 gallon can. Sample Output: [4 Gallons of Water] The 3 gallon can has 0 gallons of water. The 5 gallon can has 0 gallons of water. Options 1) Fill the 5 gallon can from the fountain 2) Fill the 3 gallon can from the fountain 3) Pour the 5 gallon can into the 3 gallon jug 4) Pour the 3 gallon can into the 5 gallon jug 5) Empty the 5 gallon can into the fountain 6) Empty the 3 gallon can into the fountain What will you do? 1 The 3 gallon can has 0 gallons of water. The 5 gallon can has 5 gallons of water. Options 1) Fill the 5 gallon can from the fountain 2) Fill the 3 gallon can from the fountain 3) Pour the 5 gallon can into the 3 gallon jug 4) Pour the 3 gallon can into the 5 gallon jug 5) Empty the 5 gallon can into the fountain 6) Empty the 3 gallon can into the fountain What will you do? 3 The 3 gallon can has 3 gallons of water. The 5 gallon can has 2 gallons of water. In the cinema classic Die Hard With a Vengeance, Bruce Willis and Samuel L. Jackson are presented with a difficult challenge by Jeremy Irons. They are given a 3 gallon can, a 5 gallon can, and a fountain of water. Their goal is to have exactly 4 gallons of water left in the can. For this assignment, you will recreate this harrowing game using loops. You will present the user with the following options: 1. Fill the 5 gallon can from the fountain 2. Fill the 3 gallon can from the fountain 3. Pour the 5 gallon can into the 3 gallon jug 4. Pour the 3 gallon can into the 5 gallon jug 5. Empty the 5 gallon can into the fountain 6. Empty the 3 gallon can into the fountain You should then calculate the amount of water in each can and display it to the user. Note that if the 3 gallon can is full, option # 3 should have no effect. Likewise, if the 5 gallon can ful option #4 should have no effect. The game will end when there is exactly 4 gallons of water in the 5 gallon can. Sample Output: [4 Gallons of Water] The 3 gallon can has 0 gallons of water. The 5 gallon can has 0 gallons of water. Options 1) Fill the 5 gallon can from the fountain 2) Fill the 3 gallon can from the fountain 3) Pour the 5 gallon can into the 3 gallon jug 4) Pour the 3 gallon can into the 5 gallon jug 5) Empty the 5 gallon can into the fountain 6) Empty the 3 gallon can into the fountain What will you do? 1 The 3 gallon can has 0 gallons of water. The 5 gallon can has 5 gallons of water. Options 1) Fill the 5 gallon can from the fountain 2) Fill the 3 gallon can from the fountain 3) Pour the 5 gallon can into the 3 gallon jug 4) Pour the 3 gallon can into the 5 gallon jug 5) Empty the 5 gallon can into the fountain 6) Empty the 3 gallon can into the fountain What will you do? 3 The 3 gallon can has 3 gallons of water. The 5 gallon can has 2 gallons of water.
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program to recreate the water puzzle from Die Hard With a Vengeance using loops pytho... View the full answer
Related Book For
South-Western Federal Taxation 2019 Comprehensive
ISBN: 9781337703017
42th Edition
Authors: David M. Maloney, William A. Raabe, William H. Hoffman, James C. Young
Posted Date:
Students also viewed these accounting questions
-
2). King Tut ruled ancient Egypt from 1332 to 1323 B.C., but died as a teenager. An analysis of STR markers carried out on samples from the mummies of King Tut and several other mummies found in...
-
Forty-eight cubic meters of sewage sludge containing 3.5% solids by mass is fed daily into an anaerobic digester. The solids in the sludge are 68% organic and 32% inert by mass. Some of the organic...
-
In the movie Die Hard 3, Bruce Willis and Samuel L. Jacksonwere confronted with the following puzzle. They were given a3-gallon jug and a 5-gallon jug and were asked to fill the 5-gallonjug with...
-
In a recombinant protein expression process the host microorganism, Pichia pastoris needs to be separated from the culture supernatant after production. A pilot scale bioreactor with a working volume...
-
(a) Suppose the horizontal distance between P and Q is 100 ft. Write equations in a, b, and c that will ensure that the track is smooth at the transition points (b) Solve the equations in part (a)...
-
Why can we not guarantee that BCNF relation schemas will be produced by dependency-preserving decompositions of non-BCNF relation schemas? Give a counterexample to illustrate this point.
-
Suppose an investor has exponential utility function $U(x)=$ $-e^{-a x}$ and an initial wealth level of $W$. The investor is faced with an opportunity to invest an amount $w \leq W$ and obtain a...
-
Calculating EAC A five-year project has an initial fixed asset investment of $240,000, an initial NWC investment of $20000, and an annual OCF of $32,000. The fixed asset is fully depreciated over the...
-
) 2345- ohao123_ w Quiz: Online Homework 4 + 3 -> C canvas.uw.edu/courses/1634621/quizzes/1823785/take M Gmail YouTube New folder useful Question 1 gs 24 2X R2.00 2X R.75 4X R2.50 NE 42nd St WB...
-
Complete Alvins Music Inc.s (AMI) 2020 Form 1120, Schedule D, and Schedule G (if applicable) using the information provided below. Neither Form 4562 for depreciation nor Form 4797 for the sale of...
-
Determine the Net Force on a 1.3 kg cart is subject to if it has three forces applied to it: 110 Newtons @ 25 East of North, 120 N @ 20 South of East & 100 N, North. (5) va
-
If a 10 percent increase in income causes the number of students who choose to attend private universities to go up by 5 percent, what is the income elasticity of demand for private universities?
-
What is the elasticity of demand for season ski passes? When the price of a season ski pass is $400, buyers, whose demand curve for passes is linear, wish to purchase 10,000 passes per year, but when...
-
Indicate whether each of the following statements is true or false by writing T or F in the answer c olumn. The implied warranty of merchantability means that all merchants warrant their goods to be...
-
Which of the following factors would affect a buyers reservation price for a given good or service: social influence, the price of the good, or the cost of producing the item?
-
Design a lag-compensator for a unity feedback system with forward transmittance \[ \mathrm{G}(s)=\frac{\mathrm{K}}{(s+1)(s+3)(s+5)} \] to yield the following specifications: (i) peak overshoot \(\leq...
-
Does technology use affect people's eating habits?
-
Provide a draft/outline of legal research involving an indigenous Canadian woman charged with assault causing bodily harm under (Sec 267b) of the Criminal Code, where the crown wants a 12-month jail...
-
Find 21 current article (not more than two years old) discussing tux inversions and the Regulations created to address the issue. Send :1 one-puge summary of the article to your instructor.
-
What are the most significant credits claimed by individual taxpayers? How do the credits claimed differ by income class? To answer these questions, go to the IRS Tax Statistics page...
-
In 2017, Fred invested $50,000 in a general partnership. Freds interest is not considered to be a passive activity. If his share of the partnership losses is $35,000 in 2017 and $25,000 in 2018, how...
-
In what way are glaciers like dirty snowballs?
-
Distinguish between mechanical and chemical weathering.
-
Name an environment where wind shapes the landscape to a significant degree.
Study smarter with the SolutionInn App