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
gladu [14]
3 years ago
12

Your local Publixsupermarket is reprogramming their cash registersand you are their software developer. The machine will output

the amount of change that must be given to the customerbroken down into each coin. Write a program that asks the user to entertheir name as well as theamount of change in CENTS. The program shouldthenoutput the amount of half dollars,quarters, dimes, nickels, and pennies to be returned to the customer (in that order) to arrive at the total amount of change inputted by the customer.
Computers and Technology
1 answer:
Verdich [7]3 years ago
7 0

Answer:

name = input("Enter name: ")

change = float(input("Enter change in cents: "))

half_dollars = int(change / 50)

change %= 50

quarters = int(change / 25)

change %= 25

dimes = int(change / 10)

change %= 10

nickels = int(change / 5)

change %= 5

pennies = int(change)

print("Half dollars: " + str(half_dollars) + ", Quarters: " + str(quarters) + ", Dimes: " + str(dimes) + ", Nickels: " + str(nickels) + ", Pennies: " + str(pennies))

Explanation:

*The code is in Python.

Ask the user to enter the name and change in cents

Calculate the number of half dollars, quarters, dimes, nickels, and pennies, use division and modulo operator

Print the results

Let me demonstrate calculating the half_dollars:

Let's say the user enter 134 for the change.

half_dollars = int(change / 50) → int(134/50) → int(2.68) = 2

change %= 50 (same as change = change % 50) → 134 % 50 → 34

You might be interested in
Explain drawing and painting package.​
Murljashka [212]
Enhances drawing experiences, adds more features and adds better quality

8 0
3 years ago
Super computer in nuclear energy ​
satela [25.4K]

Answer:

Dubbed “El Capitan,” the supercomputer is part of the Exascale Computing Project, a DOE effort to increase computing power so that the department can run highly advanced simulations and modelling of the United States' nuclear arsenal. These simulations help alleviate the need for underground testing.

4 0
3 years ago
For which input values will the following loop not correctly compute the maximum of the values? 1. Scanner in = new Scanner (Sys
My name is Ann [436]

Answer:

The answer is "Option d".

Explanation:

Please find the complete question in the attached file.

8 0
3 years ago
What is the name of the first practical asymmetric cryptosystem that was created?
victus00 [196]

Answer:

I think the name is RSA

4 0
3 years ago
I used a walmart MoneyCard and now it says its prepaid. Its my dad's card.
Scorpion4ik [409]

Answer:

oh- Did he find out-

Explanation:

8 0
3 years ago
Other questions:
  • 3.What is deep focus, and when is it a good choice for a scene?
    8·1 answer
  • True / False<br> 1. A byte is a standardized unit of measure that is always 8-bits.
    7·1 answer
  • In order to do a binary search on an array Group of answer choices you must first do a sequential search to be sure the element
    5·1 answer
  • What is the Documenter?
    10·1 answer
  • Are computer virus and human virus the same​
    6·1 answer
  • JUST NEED TO KNOW WHO ALL DOSE EDGINUITY
    12·2 answers
  • Give an idea of a law u would like to create
    5·2 answers
  • On the MarketingConsultants worksheet, in cells D10:H13, use a PMT function to calculate the end of the month payment amount. En
    15·1 answer
  • How do i mark brainliest?
    6·2 answers
  • Which website offers guidance on putting together a checklist to provide guidance on configuring and hardening operating systems
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!