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
cluponka [151]
3 years ago
5

Plz hurry it’s timed

Computers and Technology
1 answer:
yan [13]3 years ago
4 0
A manufacturing company
You might be interested in
Develop a program working as a soda vending machine. The program should show the product menu with price and take user input for
Kipish [7]

Answer:

Explanation:

The following vending machine program is written in Python. It creates various functions to checkItems, check cash, check stock, calculate refund etc. It calls all the necessary functions inside the main() function. The output can be seen in the attached picture below.

class Item:

   def __init__(self, name, price, stock):

       self.name = name

       self.price = price

       self.stock = stock

   def updateStock(self, stock):

       self.stock = stock

   def buyFromStock(self):

       if self.stock == 0:

           # raise not item exception

           pass

       self.stock -= 1

class VendingMachine:

   def __init__(self):

       self.amount = 0

       self.items = []

   def addItem(self, item):

       self.items.append(item)

   def showItems(self):

       print('Items in Vending Machine \n----------------')

       for item in self.items:

           if item.stock == 0:

               self.items.remove(item)

       for item in self.items:

           print(item.name, item.price)

       print('----------------\n')

   def addCash(self, money):

       self.amount = self.amount + money

   def buyItem(self, item):

       if self.amount < item.price:

           print('You can\'t but this item. Insert more coins.')

       else:

           self.amount -= item.price

           item.buyFromStock()

           print('You chose ' +item.name)

           print('Cash remaining: ' + str(self.amount))

   def containsItem(self, wanted):

       ret = False

       for item in self.items:

           if item.name == wanted:

               ret = True

               break

       return ret

   def getItem(self, wanted):

       ret = None

       for item in self.items:

           if item.name == wanted:

               ret = item

               break

       return ret

   def insertAmountForItem(self, item):

       price = item.price

       while self.amount < price:

               self.amount = self.amount + float(input('insert ' + str(price - self.amount) + ': '))

   def calcRefund(self):

       if self.amount > 0:

           print(self.amount + " refunded.")

           self.amount = 0

       print('Thank you!\n')

def main():

   machine = VendingMachine()

   item1 = Item('Kit Kat',  1.5,  2)

   item2 = Item('Potato Chips', 1.75,  1)

   item3 = Item('Snickers',  2.0,  3)

   item4 = Item('Gum',  0.50, 1)

   item5 = Item('Doritos',0.75,  3)

   machine.addItem(item1)

   machine.addItem(item2)

   machine.addItem(item3)

   machine.addItem(item4)

   machine.addItem(item5)

   print('Welcome!\n----------------')

   continueBuying = True

   while continueBuying == True:

       machine.showItems()

       selected = input('select item: ')

       if machine.containsItem(selected):

           item = machine.getItem(selected)

           machine.insertAmountForItem(item)

           machine.buyItem(item)

           a = input('buy something else? (y/n): ')

           if a == 'n':

               continueBuying = False

               machine.calcRefund()

           else:

               continue

       else:

           print('Item not available. Select another item.')

           continue

if __name__ == "__main__":

   main()

8 0
3 years ago
The Green Revolution innovations in agriculture based on a package of inputs including all of the following except?
timofeeve [1]

Answer:

natural fertilizers such as compost, green maure, animal manure

Explanation:

The Green Revolution was a movement whose main goal was to drastically increase the agriculture yields in every location. They accomplished this by using hybrid seeds, irrigation, chemical fertilizers, pesticides, fossil fuels, farm machinery, and high-tech growing and processing systems, all of which greatly contributed towards this goal. Therefore the one thing that was not part of the Green Revolution's innovations was natural fertilizers such as compost, green maure, animal manure, mainly due to the fact that these were the traditional use that would lead to the same agriculture yields.

6 0
3 years ago
In fixed-width files, each record is on a separate line and the fields are separated by a special character.
Vesnalui [34]

Answer:

B. False.

Explanation:

Microsoft Access is a database application used to create and query existing database.

A fixed-width file in access is a file in which each record appears on a separate line and the width of each fields are consistent across records. This means a seven character field remains a seven character field from record one to the nth record.

So the field is a fixed-width file is not separated by a special character.

3 0
3 years ago
Which letter shows the ball when it has the maximum kinetic energy
DedPeter [7]

Answer:

D.

Explanation:

Kinetic energy can be defined as an energy possessed by an object or body due to its motion.

Mathematically, kinetic energy is given by the formula;

K.E = \frac{1}{2}MV^{2}

Where;

  • K.E represents kinetic energy measured in Joules.
  • M represents mass measured in kilograms.
  • V represents velocity measured in metres per seconds square.

Generally, when the final velocity at which a physical object moves is equal to zero (0), then it possess maximum kinetic energy.

Hence, the letter which shows the ball when it has the maximum kinetic energy in the graph attached is D.

5 0
3 years ago
Which activity represents a violation of the licensing agreement
kvasek [131]
Could you give the answers it gives you? It should be along the lines of purposeful destruction of equipment.
5 0
4 years ago
Read 2 more answers
Other questions:
  • Which of the following is true about a point-and-shoot camera? They always have lenses that you can take on and off. They are of
    8·2 answers
  • Why is a port scan detected from the same ip on a subnet an alarming alert to receive from yourids?
    5·1 answer
  • I am confused in Java!
    12·1 answer
  • One of the earliest uses of an electronic digital computer involved ________.
    8·1 answer
  • Microprocessors can’t directly understand programming languages, so programs have to be converted into _____________ that corres
    15·1 answer
  • COMPUTER FUNDIMENTAL HELP 20 POINTS!!!
    5·1 answer
  • A Windows computer on your network is having issues resolving queries for a specific domain, but not other domains. Other comput
    15·1 answer
  • Which type of memory helps in reading as well as writing data? With the help of , a computer can read as well as write or modify
    11·3 answers
  • A Python keyword ______________.
    15·1 answer
  • What is the minimum number of bits needed to store the decimal value 200?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!