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
patriot [66]
4 years ago
7

I have the following assignment for Computer science class that is due tomorrow. Can someone help me to solve the code? I'm a be

ginner, so I don't have enough experience to solve the problem.
Write a program that determines the change to be dispensed from a vending machine. An item in the machine can cost between 25 cents and a dollar, in 5 cents increments (25,30,35,40,.......90,95 or 100), and the machine accepts only a single bill to pay for the item.

For example, a possible dialogue with the user might be

Enter the price of the item

(from 25 cents to a dollar, in 5-cent increment) : 45

You bought an item for 45 cents and gave me a dollar.

So your change is :

2 quarters

0 dimes, and

1 nickel.
Computers and Technology
1 answer:
DaniilM [7]4 years ago
7 0

Hello. I have a solution with comments to help you understand the code.

Brainly is bad for formatting code. Teachers often search up submitted answers using services such as search engine. Your answer has been encoded to protect you from plagiarism detection. It is very easy to view the answer for yourself.

Please go to website https://base64.io

Then copy the below text and paste it into the decode textbox in the website. Make sure you remove the part that says, "Read more on Brainly.com...". Thank you.

<em>--- COPY EVERYTHING BELOW AND PASTE INTO SITE, REMOVE THE PART THAT SAYS, "Read more on Brainly.com..." ---</em>

aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKcHVibGljIGNsYXNzIE15Q2xhc3MgewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nIGFyZ3NbXSkgewogICAgICAgIC8vIENyZWF0ZSBTY2FubmVyIG9iamVjdCB0byByZWFkIHVzZXIgaW5wdXQKICAgICAgICBTY2FubmVyIHByaWNlc2Nhbm5lciA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CiAgICAKICAgICAgICAvLyBQcmludCB0byBhc2sgdXNlciB0byB0eXBlIGluIHByaWNlCiAgICAgICAgU3lzdGVtLm91dC5wcmludCgiRW50ZXIgc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gIAogICAgICAgICAgICAvLyBMb29wIGRpdmlkZSB1bnRpbCBubyBtb3JlIGRpbWVzIGFibGUgdG8gYmUgZGl2aWRlZAogICAgICAgICAgICB3aGlsZSAocHJpY2UgLyAxMCA+IDApIHsKICAgICAgICAgICAgICAgIGRpbWVzID0gZGltZXMgKyAxOwogICAgICAgICAgICAgICAgcHJpY2UgPSBwcmljZSAtIDEwOwogICAgICAgICAgICB9CiAgICAgIAogICAgICAgICAgICAvLyBMb29wIGRpdmlkZSB1bnRpbCBubyBtb3JlIG5pY2tlbHMgYWJsZSB0byBiZSBkaXZpZGVkCiAgICAgICAgICAgIHdoaWxlIChwcmljZSAvIDUgPiAwKSB7CiAgICAgICAgICAgICAgICBuaWNrZWxzID0gbmlja2VscyArIDE7CiAgICAgICAgICAgICAgICBwcmljZSA9IHByaWNlIC0gNTsKICAgICAgICAgICAgfQogICAgICAKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJZb3VyIGNoYW5nZToiKTsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJRdWFydGVyczogIiAgKyBxdWFydGVycyk7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiRGltZXM6ICIgKyBkaW1lcyk7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiTmlja2VsczogIiArIG5pY2tlbHMpOwogICAgICAgIH0gCiAgICB9Cn0=

You might be interested in
1. I write about my travel experiences on my own personal ____?
alekssr [168]

Answer:

Hello There!!

Explanation:

1.blog

2.laptop

hope this helps,have a great day!!

~Pinky~

4 0
3 years ago
Use the worksheet _____ tools in the lower left-hand corner of the Excel screen to scroll through the sheet tabs.
sveta [45]
I think is D ...............
6 0
3 years ago
Read 2 more answers
84.6% complete question a network administrator is installing a device that uses redundant array of independent disks (raid) tec
Alja [10]

The device that this network administrator is most likely installing in the infrastructure is a Network Attached Storage (NAS).

<h3>What is a Network Attached Storage (NAS)?</h3>

A Network Attached Storage (NAS) can be defined as a file-dedicated storage device that is designed and developed to enable multiple end users and other heterogeneous client devices to store, share and retrieve data anywhere from a centralized disk, especially through a network.

In this context, we can infer and logically conclude that a Network Attached Storage (NAS) is the device that this network administrator is most likely installing in the infrastructure because it doesn't require licensing and the data stored on it at the file level can be accessed anywhere.

Read more on Network Attached Storage here: brainly.com/question/14456295

#SPJ1

3 0
2 years ago
What shows the web address of the page that is currently displayed in the workspace?
babunello [35]

Answer:

In a web browser, the address bar (also location bar or URL bar) is a GUI widget that shows the current URL. The user can type a URL into the bar to navigate to a chosen website.

6 0
3 years ago
Read 2 more answers
A. Write a Python program to match key values in two dictionaries. Input: {'key1': 1, 'key2': 3, 'key3': 2}, {'key1': 1, 'key2':
KIM [24]

Answer:

Please find the attachment of the code file and its output:

Explanation:

In the first code, two variable "a, b" is defined that holds dictionary value which is defined in the question, in the next step a for loop is declared that hold dictionary key and value and use a method set to check the value is available in the dictionary and use print method to print its value.

In the second code, a package counter is an import as the c for count value, in the next step a variable a is declared, that uses a counter method to hold a dictionary value in its parameter, and in the print method, it uses sort method to print its value.

8 0
3 years ago
Other questions:
  • 2. How do web bugs invade a person’s privacy?
    10·2 answers
  • What allows files containing text, programs, graphics, numerical data and so on to be downloaded off or uploaded onto a network?
    13·1 answer
  • In which of these places might you be most likely to find a peer-to-peer network? On the Internet In a hospital In a home In a l
    5·2 answers
  • How many suggestions available in correcting misspelled words<br>​
    11·1 answer
  • What is the biggest type of gear?<br><br>A. Spur<br>B.Worm<br>C.Wheel<br>D.Pinion
    6·2 answers
  • Which vulnerability can occur if a programmer does not properly validate user input and allows an attacker to include unintended
    13·1 answer
  • What should you remember about typography while creating your résumé?
    5·1 answer
  • Write your question here (Keep it clear and simple to get the best answer)
    13·2 answers
  • Write a program that calculates the amount of money in a savings account that earns a guaranteed yearly interest rate. The progr
    9·1 answer
  • In 2008, researchers at Princeton University demonstrated techniques to retrieve RAM contents after the computer had been powere
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!