Question

This should be a python project.I need help with programming project in python. Here are the...

This should be a python project.I need help with programming project in python. Here are the instructions: (75 points) Program runs successfully (10 points) Inputs weight from the user using a Scanner object. (5 points) Outputs all drink options in simple format (10 points) Inputs drink choices from the user using a Scanner object (5 points) Repeats until -1 is entered (45 points) Outputs the final summary correctly (25 points) Program contents follow readability standards including: (15 points) Correct use of ArrayList lists (10 points) Successfully complete simple and detailed format methods in Beverage class Summary We will create a detailed EBAC (Estimated Blood Alcohol Content) Tracker. Along with sobriety, we will also track calorie content and cost data to better help the user choose their drinks for the night. This data varies greatly based on the location, venue, and bartender, but very rough estimates are provided for the purpose of this project. Details Your program will need to start by asking the user for their weight to the nearest pound, then ask them to input each drink they have. These drinks are defined below, and you must use these items in the exactly the same order, though you can add items at the end of the list if desired. We will use standard values for the rest of the items required in the formula and assume that all drinks are consumed at the same time for simplicity. When the user enters -1 for their drink choice you will print a final summary that includes: 1) Every drink they had that night with its detailed summary (alcohol content, calories, and cost), 2) Their bill for the night 3) Their total calories consumed, 4) Their final EBAC, and 5) How long until they are complete sober again. Below is a sample run of the program, with the user input in green/bold/underlined format. To complete this project, you are required to use ArrayLists and the Beverage object that I provided for you. (This means you may NOT use primitive arrays.) Note: When I test your projects, I will always enter valid data, but I will not enter the exact values from below. I will alter the weight, number of drinks, and drink selections to fully test your program. Welcome to the EBAC Calculator! Please enter your weight to the nearest pound: 150 Please enter the number of the item you would like to drink: (-1 to exit) 0) Bourbon and Water ($6.0) 1) Cosmopolitan ($7.0) 2) Gin and Tonic ($6.0) 3) Mojito ($6.0) 4) Margarita ($7.5) 5) Martini ($7.0) 6) Pina Colada ($6.0) 7) Screwdriver ($7.0) 8) Vodka and Tonic ($6.0) 9) Water ($0.0) 1 Please enter the number of the item you would like to drink: (-1 to exit) 0) Bourbon and Water ($6.0) 1) Cosmopolitan ($7.0) 2) Gin and Tonic ($6.0) 3) Mojito ($6.0) 4) Margarita ($7.5) 5) Martini ($7.0) 6) Pina Colada ($6.0) 7) Screwdriver ($7.0) 8) Vodka and Tonic ($6.0) 9) Water ($0.0) 2 Please enter the number of the item you would like to drink: (-1 to exit) 0) Bourbon and Water ($6.0) 1) Cosmopolitan ($7.0) 2) Gin and Tonic ($6.0) 3) Mojito ($6.0) 4) Margarita ($7.5) 5) Martini ($7.0) 6) Pina Colada ($6.0) 7) Screwdriver ($7.0) 8) Vodka and Tonic ($6.0) 9) Water ($0.0) 9 Please enter the number of the item you would like to drink: (-1 to exit) 0) Bourbon and Water ($6.0) 1) Cosmopolitan ($7.0) 2) Gin and Tonic ($6.0) 3) Mojito ($6.0) 4) Margarita ($7.5) 5) Martini ($7.0) 6) Pina Colada ($6.0) 7) Screwdriver ($7.0) 8) Vodka and Tonic ($6.0) 9) Water ($0.0) 4 Please enter the number of the item you would like to drink: (-1 to exit) 0) Bourbon and Water ($6.0) 1) Cosmopolitan ($7.0) 2) Gin and Tonic ($6.0) 3) Mojito ($6.0) 4) Margarita ($7.5) 5) Martini ($7.0) 6) Pina Colada ($6.0) 7) Screwdriver ($7.0) 8) Vodka and Tonic ($6.0) 9) Water ($0.0) -1 Final Summary You had the following drinks tonight: Cosmopolitan 2.0 oz 212 cal $7.0 Gin and Tonic 2.0 oz 175 cal $6.0 Water 0.0 oz 0 cal $0.0 Margarita 2.5 oz 153 cal $7.5 Your bill for the night is: $20.5 You have consumed 540 calories. Your final EBAC is 0.3181904761904762 It will be 6.5 hours until you are sober again Good night! Required Values The formula for EBAC that we will use is: ouncesOfAlcohol * 5.14 / (weight * 0.7). Since we are using 1 ounce/hour as an estimate for alcohol processing, the ouncesOfAlcohol value is also the hours until the user is sober again. Here are the drinks that you will need to use in your program, in this order. Notice that the first drink starts at 0. You may add additional drinks starting at index 10 if desired. Index Name Ounces of Alcohol Calories Cost 0 Bourbon and Water 2 140 6.00 1 Cosmopolitan 2 212 7.00 2 Gin and Tonic 2 175 6.00 3 Mojito 2 242 6.00 4 Margarita 2.5 153 7.50 5 Martini 2.5 127 7.00 6 Pina Colada 3 440 6.00 7 Screwdriver 2 181 7.00 8 Vodka and Tonic 2 200 6.00 9 Water 0 0 0

0 0
Add a comment Improve this question Transcribed image text
Answer #1

class EBAC:
def method():
print("Welcome to the EBAC Calculator! Please enter your weight to the nearest pound:")
weight=int(input())
list1=[]
flag=1
oz=[2.0,2.0,2.0,2.0,2.0,2.5,2.5,3.0,2.0,2.0,0.0]
list3=[6,7,6,6,7.5,7,6,7,0]
cal=[140,212,175,242,153,127,440,181,200,0]
list2=["Bourbon and Water 2.0 oz 140 cal $6.0","Cosmopolitan 2.0 oz 212 cal $7.0","Gin and Tonic 2.0 oz 175 cal $6.0","Mojito 2.0 oz 242 cal $6.0","Margarita 2.5 oz 153 cal $7.5","Martini 2.5 oz 127 cal $7.0","Pina Colada 3.0 oz 440 cal $6.0","Screwdriver 2.0 oz 181 cal $7.0", "Vodka and Tonic 2.0 oz 200 cal $6.0","Water 0.0 oz 0 cal $0.0"]
while(flag!=-1):
print("Please enter the number of the item you would like to drink:(-1 to exit) 0) Bourbon and Water ($6.0)1) Cosmopolitan ($7.0) 2) Gin and Tonic ($6.0) 3) Mojito ($6.0) 4) Margarita ($7.5)5) Martini ($7.0) 6) Pina Colada ($6.0) 7) Screwdriver ($7.0) 8) Vodka and Tonic ($6.0) 9) Water ($0.0) ")
flag=int(input())
list1.append(flag)
print("Final Summary You had the following drinks tonight:")
for i in list1:
print(list1[i])
cost=0
calories=0
hours=0
for i in list1:
cost=cost+list3[i]
calories=calories+cal[i]
hours=hours+oz[i]
print("Your bill for the night is:$",cost)
print("You have consumed ",calories," calories")
#The formula for EBAC that we will use is: ouncesOfAlcohol * 5.14 / (weight * 0.7)
ouncesofAlcohol=calories*oz
value= ouncesofAlcohol*5.14/(weight*0.7)
print("Your final EBAC is",value,"It will be ",hours," hours until you are sober again Good night!")
Beverage=EBAC()
print(Beverage.method)

Add a comment
Know the answer?
Add Answer to:
This should be a python project.I need help with programming project in python. Here are the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Programming Language is Python Need it to look just like the sample output. pls and ty!!...

    Programming Language is Python Need it to look just like the sample output. pls and ty!! Design your solution: 1. Main menu: Create a main user menu to display the main options to the user. User have the option to choose between 1 and 4. The program will display an error message if user option is not within the valid selection (less than 1 and greater than 4). Think about using a conditional structure to serve the user choice. Invalid...

  • python programming you should use While loop For loop Range() Break Continue Here is a quick...

    python programming you should use While loop For loop Range() Break Continue Here is a quick story about two elephants who live in the Potowatomi Zoo. Every evening the elephants each randomly select one of six sleeping pens to spend the night in. After deciding on which pen, they simultaneously enter the pen from opposite sides. Being slightly vision impaired, they cannot see if the other elephant entered the same pen until it is too late to turn around and...

  • I really need help with this python programming assignment asap please double check indentations, thank you...

    I really need help with this python programming assignment asap please double check indentations, thank you We were unable to transcribe this imageEnter a drink option: Milk 22 Guest #1: a Please select the number of your entree choice 1) Planked salmon, 2) Prime rib, 3) Sesame tofu with spinach: 3 Please select the number of your dessert choice 27 1) Caramel oat bar, 2) Chocolate decadence, 3) Orange creme brulee: 1 Please select the number of your drink choice...

  • Below is my case study, I have already answered the first two questions but need help...

    Below is my case study, I have already answered the first two questions but need help with the last two. Denzel Armstrong Case Study Welcome to Dr. Jones’s busy general practice clinic where he sees patients of varying ages. You are one of three RNs in the clinic and your general duties include assessment, patient education, assistance with minor dressing changes, obtaining routine labs (i.e. urine, blood etc.) to name just a few. You have been a nurse for five...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT