Write a program called whilebun.py, in which the user is asked to guess the name of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program called whilebun.py, in which the user is asked to guess the name of your favorite DBVac vacuum cleaner model. Your program should: • Include a comment in the first line with your name. Include comments describing each major section of code. • Set a variable called favvac to be equal to the name of your favorite DBVac vacuum cleaner model (i.e., Bunny King, etc.). • Ask the user to guess the name. Allow the user to make up to three guesses, evaluating each guess for correctness immediately after the guess is made. o The user's guess shouldn't be required to be case sensitive to be correct. For instance, if your favorite model is the Hare Razer, but the user inputs "HARE RAZER", then that should be counted correct (as should "hare razer", "hArE rAzEr" and any other combination of capital and lower-case letters). o If the user guesses wrong, let them know, tell them how many guesses they have left, and have them guess again (up to three guesses total). If the user is down to their last guess, give them a hint by telling them what the first letter of the vacuum cleaner model is. To do this, use the variable (favvac) and an index value. If the user guesses the correct name: o o o Stop asking the user to guess (even if they have not yet guessed three times). Congratulate the user on their guessing skills. Tell the user how many guesses it took them to guess correctly. • If the user runs out of guesses without guessing the correct name: Console the user by telling them that, while they have failed in this task, it's going to be okay. Write a program called whilebun.py, in which the user is asked to guess the name of your favorite DBVac vacuum cleaner model. Your program should: • Include a comment in the first line with your name. Include comments describing each major section of code. • Set a variable called favvac to be equal to the name of your favorite DBVac vacuum cleaner model (i.e., Bunny King, etc.). • Ask the user to guess the name. Allow the user to make up to three guesses, evaluating each guess for correctness immediately after the guess is made. o The user's guess shouldn't be required to be case sensitive to be correct. For instance, if your favorite model is the Hare Razer, but the user inputs "HARE RAZER", then that should be counted correct (as should "hare razer", "hArE rAzEr" and any other combination of capital and lower-case letters). o If the user guesses wrong, let them know, tell them how many guesses they have left, and have them guess again (up to three guesses total). If the user is down to their last guess, give them a hint by telling them what the first letter of the vacuum cleaner model is. To do this, use the variable (favvac) and an index value. If the user guesses the correct name: o o o Stop asking the user to guess (even if they have not yet guessed three times). Congratulate the user on their guessing skills. Tell the user how many guesses it took them to guess correctly. • If the user runs out of guesses without guessing the correct name: Console the user by telling them that, while they have failed in this task, it's going to be okay.
Expert Answer:
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Googles ease of use and superior search results have propelled the search engine to its num- ber one status, ousting the early dominance of competitors such as WebCrawler and Infos- eek. Even later...
-
A managers key task is to balance which four customer service factors against which six logistics cost factors?
-
Gilliam Wholesalers accepts from Perlman Stores a $6,200, 4-month, 9% note dated May 31 in settlement of Perlmans overdue account. The maturity date of the note is September 30. What entry does...
-
Why would a global firm or multinational require that a wholly owned foreign subsidiary sign a management contract when it already owns the subsidiary?
-
Let \(\left(K_{t}^{u}, t \geq 0 ight)\) be a family of \(\mathbf{F}\)-predictable processes indexed by \(u \geq 0\) (i.e., for any \(u \geq 0, t ightarrow K_{t}^{u}\) is \(\mathbf{F}\)-predictable)....
-
A business student at Nowledge College must complete a total of 65 courses to graduate. The number of business courses must be greater than or equal to 23 the number of non business courses must be...
-
Explain the arbitrage strategies employed by Long Term Capital Management (LTCM) and why such strategies may be considered well-founded and explain how basis risk contributed to LTCM's ultimate...
-
Obtain the Laplace transform of f (t) in Fig. 15.28 . f(t) A 15 1 2 3 4 t
-
Write a program to accept a number from 1 to 7 and display the name of the day (ex. 1 for Sunday, 2 for Monday, etc.). Ask the user to enter a number 1-7. This program should use the if-elif-else...
-
1.Sales were $100,000 two months ago and increased by 20% last month. How much were sales last month?1 4 Sales were $120,000 last month and decreased by 20% this month. How much were sales this...
-
The following financial statement information is from five separate companies. Company A Company B Company C Company D Company E December 31, 2018 Assets $ 44,000 $ 34,320 $ 28,160 $ 78,320 $ 120,120...
-
2. Please respond to the following questions in a minimum of 250 words: a. Illustrate the transactional model. You may note that meanings exist among people (e.g., difference between "quitting" and...
-
Higher Order Thinking At the state fair, a person must be at least 138 centimeters tall to ride the roller coaster. Chiko wants to ride the coaster. He is 4 feet 7 inches tall. Is Chiko tall enough...
-
I. Determine the par yield rates (yields to maturity on par bonds) and forward rates (the ones with ? below) based on the spot curve given below. Make sure that you show your work, not just the...
-
Write an opinionated response to the article. Leadership Matters! Elon Musk is widely regarded as one of the most suc- cessful entrepreneurs in history. 130 He became a bil- lionaire by age 31 after...
-
on 8 For the following set of lengths 130, 170, 160, 160, 150, 190 Third quartile is: et red d out of Select one: O a. 160 a question O b. 145 O c. 175 O d. 180
-
Write a program that converts dates from numerical month-day format to alphabetic month-day format. For example, input of 1/31 or 01/31 would produce January 31 as output. The dialogue with the user...
-
Create a JavaFX application that displays a button with the text Button 1. Underneath the button add a label with the text Label 1. Repeat with and additional Button 2 and Label 2. Add an image icon...
-
Add a method bubbleSort to the class ArraySorter, as given in Listing 7.10, that performs a bubble sort of an array. The bubble sort algorithm examines all adjacent pairs of elements in the array...
-
In the Skycoaster amusement park ride, riders are suspended from a tower by a long cable. A second cable then lifts them until they reach the starting position indicated in Figure P5.3. The lifting...
-
Bethany, who weighs 560 N, lies in a hammock suspended by ropes tied to two trees. One rope makes an angle of 45 with the ground; the other makes an angle of 30. Find the tension in each of the ropes.
-
In the winter sport of curling, two teams alternate sliding 20 kg stones on an icy surface in an attempt to end up with the stone closest to the center of a target painted on the ice. During one...
Study smarter with the SolutionInn App