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]
3 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]3 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
How do i block somebody on here, theyre making me have a panic attack. /srs
spin [16.1K]

Answer:

If someone is disturbing you a lo then you can report him/her.

  • Go to g-mail.
  • Type a message to US Support.
  • Add a screenshot of him/her whom you want to report.
  • Use polite words
  • At last, send it.

You will get soon response.

5 0
3 years ago
Read 2 more answers
Time (non-statistical) division multiplexing differs from frequency division multiplexing because it:
yan [13]

Explanation:

We can divide the multiplex in different categorize, for example:

  • FREQUENCY DIVISION MULTIPLEXERS (FDM)
  • TIME DIVISION MULTIPLEXERS (TDM)
  • STATISTICAL TIME DIVISION MULTIPLEXERS (STDM).

But in this case, we're going to explain about the time and frequency, because the time division multiplex differ to frequency, because the circuit is divided horizontally, and the time is vertically

b. splits the communication circuit vertically (with time slots) instead of horizontally

7 0
3 years ago
Which type of cause and effect organizer would be best for alisha to understand how crude oil becomes gasoline?
sukhopar [10]
The answer is 100% B. Flow chart.
5 0
3 years ago
Read 2 more answers
What was Pike's objective on his first expedition in 1805?​
Furkat [3]
Zebulon Pike, the U.S. Army officer who in 1805 led an exploring party in search of the source of the Mississippi River, sets off with a new expedition to explore the American Southwest. Pike was instructed to seek out headwaters of the Arkansas and Red rivers and to investigate Spanish settlements in New Mexico.
8 0
3 years ago
4.11.4 Snake Eyes code HS<br><br> I cant see to get this right, ant help would be appreciated.
Pani-rosa [81]

Answer:

This is python, I don't know what type of programming language you are learning.

import random

# Enter your code here

dice1 = random.randint(1,6)

dice2 = random.randint(1,6)

total = 0

while True:

   if dice1 == 1 and dice2 == 1:

       total += 1

       print("Rolled: " + str(dice1) + " " + str(dice2))

       break

   else:

       total += 1

       print("Rolled: " + str(dice1) + " " + str(dice2))

       dice1 = random.randint(1,6)

       dice2 = random.randint(1,6)

       

       

print("It took you "+ str(total) + " rolls to get snake eyes.")

Explanation:

8 0
2 years ago
Other questions:
  • Which of them does not support decision making? Options DSS, GDSS, ESS All of above
    10·1 answer
  • Assume the following JavaScript program was interpreted using staticscoping rules. What value of x is displayed in function sub1
    12·1 answer
  • If Denise specifies Jan? as a search criterion, Excel will locate all of the following records EXCEPT ____.
    9·1 answer
  • The multitasking, multi-user, operating system developed by Bell Laboratories that operates on a wide variety of computing platf
    13·1 answer
  • When classified data is sent over an unclassified network, what is this incident called?
    5·1 answer
  • What do you think is the most fascinating aspect of the Internet
    5·2 answers
  • What is the purpose of a mutator?
    8·1 answer
  • or each array created, the name of the array becomes the name of the pointer constant created by the compiler for the array, and
    6·1 answer
  • Will give brainliest
    10·1 answer
  • You're making great progress on your assignment. You've defined the purpose of your message, identified both the primary and sec
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!