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
Please answer fast screenshot included - thanks in advance
aleksley [76]

Answer:

Webpage Layouts where finally designed using html code

Explanation:

4 0
3 years ago
Assessment timer and count Assessment items Item 6 How many different keys can be used in a single sort? 1 2 3 4
Alik [6]

Answer:

Its C 3. hope this helps

Explanation:

6 0
3 years ago
What level of system and network configuration is required for cui?
andrey2020 [161]

The level of system and network configuration is required for Cui will be "Moderate confidentiality".

  • The data that really should be safeguarded or disseminated under appropriate regulations, rules, and conservative government objectives or guidelines, would be considered as CUI.
  • The FISMA demands CUI Fundamental to somehow be safeguarded somewhere at the FISMA Conservative category and may even be labeled as CUI as well as regulated.

Thus the above answer is right.

Learn more:

brainly.com/question/14083709

4 0
2 years ago
Discuss one simple example of hybrid computer.​
andrezito [222]

Answer:

thermometer , petrol pump

5 0
2 years ago
If the numbers on the spring scales read 200 g. What property of the shoes is being measured?
lianna [129]
Pretty sure its mass
5 0
3 years ago
Other questions:
  • The equipment that processes data in order to create information is called the _______.
    8·2 answers
  • All of the following are examples of a web application except for ______.
    12·2 answers
  • The exercise instructions here are LONG -- please read them all carefully. If you see an internal scrollbar to the right of thes
    8·1 answer
  • Which of the following will you select as X in the following series of clicks to lay the title over a chart: Chart Title box &gt
    14·1 answer
  • The spreadsheet ends after you reach column Z and row 99. True or false
    12·1 answer
  • Who initially developed what is now known as the internet?
    5·1 answer
  • What will be the output of the following code? &lt;?php $foo = 'Bob'; $bar = $foo; $bar = "My name is $bar"; print $bar; print $
    8·2 answers
  • Assume the availability of a function named oneMore. This function receives an integer and returns one more than its parameter.
    14·1 answer
  • Write a SELECT statement that returns one row for each musician that has orders with these columns:
    13·1 answer
  • WHICH PROGRAMMING LANGUAGES ARE THE BEST FOR PROGRAMMING?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!