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
Liula [17]
3 years ago
11

A command is

Computers and Technology
1 answer:
Alona [7]3 years ago
4 0

Answer:

D

Explanation:

You might be interested in
Why do primitive types have ranges of values? what determines the range of the data type?
Alexxx [7]
What determines the range of primitive data types is a combination of the number of bytes that is allocated to them and if there's any encoding.

Not too long ago, it was normal for an integer to receive four bytes of memory. An unsigned integer would also receive four bytes of memory. The unsigned int  had a range of 0 - (2^32 - 1) because it could only be used for positive integers and could use all 32 bits. An integer has a range of (- 2^31 through +2^31 - 1). The 32nd bit is uses as a sign bit (0 for positive, 1 for negative).

Just for thoroughness: when an int is negative, it's stored as the two's complement of it's absolute value.
5 0
3 years ago
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
Color of seagrass beds on navigational charts? Please quickly
Nadya [2.5K]
Hello! The color of seagrass beds on navigational charts are brown, because they are in shallow areas and it helps you know the locations of them.
5 0
3 years ago
What is the output of the code? (CHECK IMAGE)
PIT_PIT [208]

Answer:

689

Explanation:

8 0
3 years ago
Mhairi believes that if a site’s information is detailed enough, it is more likely to be true. Is she correct? Answers
inysia [295]
In my opinion, I would say No. So I think the answer is C.
6 0
3 years ago
Read 2 more answers
Other questions:
  • John, the network administrator of XYZ Corporation, is interested in changing the format of text from the American Standard Code
    10·1 answer
  • Which of the following is the most effective password?
    15·2 answers
  • How can you prevent your VMs receiving DHCP server messages from unauthorized virtual machine pretending to be DHCP servers?
    13·1 answer
  • The __________ is the system of official channels that carry organizationally approved messages and information.
    15·1 answer
  • What can your employer do to protect you from overhead power lines?
    13·1 answer
  • QUESTION 4 PRACTICAL EXERSIZE
    7·1 answer
  • Draw a flowchart and write the algorithm to find even number between 1 to 50​
    7·1 answer
  • What is the best way of farming exotics in destiny?
    12·2 answers
  • Is a mainframe computer portable?​
    10·1 answer
  • What is the difference between DWT and CWT?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!