1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
julsineya [31]
3 years ago
11

Please write in python:

Computers and Technology
1 answer:
Alenkasestr [34]3 years ago
6 0

Week 1:

print("1. Skittles    2. M&M's\n3. Starbursts   4. Twizzlers\n5. Twix")

while True:

   item = input("Enter the number of your item to be purchased: ")

   if item == "1":

       print("You chose skittles.")

   elif item == "2":

       print("You chose M&M's.")

   elif item == "3":

       print("You chose Starbursts.")

   elif item == "4":

       print("You chose Twizzlers.")

   elif item == "5":

       print("You chose Twix.")

Week 2:

print("1. Skittles    2. M&M's\n3. Starbursts   4. Twizzlers\n5. Twix")

total = 0

while True:

   item = input("Enter the number of your item to be purchased: ")

   if item == "1":

       print("You chose skittles.")

       total += 2

   elif item == "2":

       print("You chose M&M's.")

       total += 2

   elif item == "3":

       print("You chose Starbursts.")

       total += 1

   elif item == "4":

       print("You chose Twizzlers.")

       total += 3

   elif item == "5":

       print("You chose Twix.")

       total += 4

   elif item == "exit":

       exit()

   elif item == "out":

       total += round(total*0.0625,2)

       print("Your total is: ${}".format(total))

       deposit = int(input("How much money did you input? "))

       change_due = round(deposit - total,2)

       print("Your change due is ${}".format(change_due))

   else:

       print("Please choose an option or enter \"exit\" to exit the vending machine.")

week 3:

print("1. Skittles    2. M&M's\n3. Starbursts   4. Twizzlers\n5. Twix")

total = 0

while True:

   item = input("Enter the number of your item to be purchased: ")

   if item == "1":

       print("You chose skittles.")

       total += 2

   elif item == "2":

       print("You chose M&M's.")

       total += 2

   elif item == "3":

       print("You chose Starbursts.")

       total += 1

   elif item == "4":

       print("You chose Twizzlers.")

       total += 3

   elif item == "5":

       print("You chose Twix.")

       total += 4

   elif item == "exit":

       exit()

   elif item == "out":

       total += round(total * 0.0625, 2)

       print("Your total is: ${}".format(total))

       deposit = int(input("How much money did you input? "))

       while deposit < total:

           deposit = int(

               input("Please input a dollar amount greater than or equal to the total (whole numbers only): "))

       change_due = round(deposit - total, 2)

       if change_due == 0:

           print("No change due.")

       else:

           print("You are owed {} dollars and {} cents".format(int(change_due), round(change_due - int(change_due),2)))

   else:

       print("Please choose an option or enter \"exit\" to exit the vending machine.")

week 4:

def print_menu():

   print("1. Skittles    2. M&M's\n3. Starbursts   4. Twizzlers\n5. Twix    Enter \"out\" to checkout.")

def calculate_total(new_item):

   total = 0

   if new_item == "1":

       print("You chose skittles.")

       total += 2

   elif new_item == "2":

       print("You chose M&M's.")

       total += 2

   elif new_item == "3":

       print("You chose Starbursts.")

       total += 1

   elif new_item == "4":

       print("You chose Twizzlers.")

       total += 3

   elif new_item == "5":

       print("You chose Twix.")

       total += 4

   return total

def make_change(change_due):

   print(

       "Here is your change: {} dollars and {} cents".format(int(change_due), round(int(change_due) - change_due, 2)))

   print("Have a great day")

def amount_due(total_price):

   sales_tax = 0.0625

   final_price = total_price * +(total_price * sales_tax)

   print("Subtotal: {}".format(total_price))

   print("Final total: {}".format(final_price))

   deposit = int(input("Enter how much you deposited: "))

   while deposit < final_price:

       deposit = int(input("Enter an amount greater than or equal to {}".format(final_price)))

   make_change(deposit - final_price)

total = 0

while True:

   item = input("Enter the number of your item to be purchased: ")

   if item == "1":

       print("You chose skittles.")

       total += 2

   elif item == "2":

       print("You chose M&M's.")

       total += 2

   elif item == "3":

       print("You chose Starbursts.")

       total += 1

   elif item == "4":

       print("You chose Twizzlers.")

       total += 3

   elif item == "5":

       print("You chose Twix.")

       total += 4

   elif item == "exit":

       exit()

   elif item == "out":

       sales_tax = 0.0625

       total += round(total * sales_tax, 2)

       print("Your total is: ${}".format(total))

       deposit = int(input("How much money did you input? "))

       while deposit < total:

           deposit = int(

               input("Please input a dollar amount greater than or equal to the total (whole numbers only): "))

       change_due = round(deposit - total, 2)

       if change_due == 0:

           print("No change due.")

       else:

           print(

               "You are owed {} dollars and {} cents".format(int(change_due), round(change_due - int(change_due), 2)))

   else:

       print("Please choose an option or enter \"exit\" to exit the vending machine.")

I didn't implement the functions because the problem never stated that we had to. Best of luck.

You might be interested in
The question of ________ arises when considering the way in which online marketers gather consumers’ information over the Intern
Black_prince [1.1K]

Answer: Ethics

Explanation:

6 0
3 years ago
Does anyone know what edmodo is? If you do please tell me what it is and what you do on edmodo.
Serjik [45]
Edmodo is a educational website designed to make learning and teaching easier. 

Students can speak with other students about classwork, and the teacher can also communicate assignments and give messages for the entire class. 

Of course the teacher can see all of the messages you post, so inappropriate language and not school related conversations usually end up with trouble with the teacher. 

I used this site in 7th and 8th grade 
for Language arts and Social Studies. 

But of course Edmodo can be used with any subject:)

love, the Pineapple. 
<3
3 0
3 years ago
PLS HELP!!
Vera_Pavlovna [14]

Answer:

A. f/2.8

Explanation:

A hole within a lens, through which light travels into the camera body is referred to as the APERTURE.

It is typically expressed as "f number" in photography. Basically, a fast lens is any lens with a maximum aperture of f/4 or more i.e f/2.8 , f/1.8 , f/1.4 etc.

The smaller the number is the bigger the maximum aperture is. Hence, the bigger the maximum aperture the more light that your lens will allow in.

Therefore, the ideal aperture settings for a fast lens is f/2.8

7 0
3 years ago
Is this statement true or false?
____ [38]
This answer could be either, but personally false. Humor drives attention into your work (if the humor isn’t about it then yes it would drive it far off) but it makes people focus and listen to your presentation so they would answer your jokes. Hope this helped!
7 0
3 years ago
A 10 Superscript negative 910−9​-F capacitor ​(11 nanofaradnanofarad​) is charged to 5050 V and then disconnected. One can model
vredina [299]

Answer:

Explanation:

i) On a cold day, Capacity = (66 X 910 X 10∧-9) F

Charge, Q = (66 X 910 X 10∧-9) X 5050 = 0.30 Columb

Current, I= 5050/131013 = 0.039 Amp (where Resistance = 131013 ohms)

Time, t= 0.30/0.039 = 7.7 seconds

ii) On a humid day, Capacity = (77 X 910 X 10∧-9) F

Charge, Q = ( 77 X 910 X 10∧-9) X 5050 = 0.35 Columb

Current, I= 5050/6106 = 0.83 Amp ( where Resistance = 6106 ohms)

Time, t= 0.35/0.83 = 0.42 h or  0.42 X 60 mins = 25 mins

7 0
3 years ago
Other questions:
  • Microsoft words spell checker
    8·1 answer
  • Progressively enhancing a web page for different viewing contexts (such as smartphones and tablets) through the use of coding te
    11·1 answer
  • hey computor guys. is the MSI B250M GAMING PRO LGA 1151 Intel B250 HDMI SATA 6Gb/s USB 3.1 Micro ATX Motherboards - Intel compat
    8·1 answer
  • Using an LCD projector to show an online video to a group of people is an example of:
    14·1 answer
  • What is the minimum internal temperature that the chicken must reach?
    11·1 answer
  • Question 19 :Rachel, a database administrator, has created a database for her website. It contains pictures of vacations that pe
    13·1 answer
  • Wendy had been searching the internet for a great deal on jewelry. While looking at one site, a pop-up was displayed that told h
    11·1 answer
  • I AM GIVING BRAINLIEST!!!!!!! PLEASE HELP !!!!!!!!
    7·2 answers
  • "Jan23" can be stored using which data type? O an alphanumeric string O a boolean operator o characters floating point numbers​
    13·2 answers
  • With software prefetching, it is important to be careful to have the prefetches occur in time for use but also to minimize the n
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!