Question

Please do what is asked here so I can understand a bit please. Thanks. Write a...

Please do what is asked here so I can understand a bit please. Thanks.

Write a program p3.py that computes the equivalent of a dollar amount in change using quarters, dimes, and pennies. No nickels are used for conversion. The program reads from the terminal the dollar amount in a loop while not end-of-file. Inside the loop it computes how many quarters, dimes, and pennies make up the original dollar amount and then displays the change. The program should terminate if the user types an invalid string.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

code

Output

Code for copying

while True:
try:
t=float(input("enter the Dollars : "))
print("number of quarters in {} dollars = {} quarters".format(t,float(t/0.25)))
print("number of dimes in {} dollars = {} dimes".format(t,float(t/0.10)))
print("number of pennies in {} dollars = {} pennies".format(t,float(t/0.01)))
except ValueError:
exit()

===============================================================

If you have any queries then please comment I am here to help you anytime.Please rate the answer

Add a comment
Know the answer?
Add Answer to:
Please do what is asked here so I can understand a bit please. Thanks. Write a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C program that calculates exact change. In order to receive full credit, please remember...

    Write a C program that calculates exact change. In order to receive full credit, please remember that only int arithmetic is exact, so you’ll need to break up your double into two ints, the one before the decimal point and the one after the decimal point. Another point worth mentioning is that the % operator gives the remainder. In other words, when working with int values, 9 / 5 = 1 whereas 9 % 5 = 4. Keep this in...

  • PLease help!!! how to type them in Python !!!! Python help!! THank you so much Problem...

    PLease help!!! how to type them in Python !!!! Python help!! THank you so much Problem 1: (20 points) Optimal change You will write a program that uses the // and % operators to figure out how to give change for a specified amount using the minimum number of coins (quarters, dimes, nickels, cents). The good news is that our currency is specifically designed to make this problem easy. For a given number of cents, first use as many quarters...

  • it c++ coding. please write on atom software. 1. Write a program that converts dollars into coins a. Request a dolla...

    it c++ coding. please write on atom software. 1. Write a program that converts dollars into coins a. Request a dollar amount as an integer: $5.34 is input as 534 b. Use a constant variable to represent each coin as a fixed value: const int NICKEL 5; c. Use division and the mod function to calculate the number of each coin. Change Calculator Enter dollar amount (as an integer): $534 The equivalent in coins: 21 Quarters 0 Dimes 1 Nickels...

  • Can you please help me with creating this Java Code using the following pseudocode? Make Change C...

    Can you please help me with creating this Java Code using the following pseudocode? Make Change Calculator (100 points + 5 ex.cr.)                                                                                                                                  2019 In this program (closely related to the change calculator done as the prior assignment) you will make “change for a dollar” using the most efficient set of coins possible. In Part A you will give the fewest quarters, dimes, nickels, and pennies possible (i.e., without regard to any ‘limits’ on coin counts), but in Part B you...

  • Please use C# For this project, we will see what it's like to write a simple...

    Please use C# For this project, we will see what it's like to write a simple windows application program that we can perform easily in our heads. You'll find that writing programs is similar to explaining things to a 5-year-old. You are to make this program "user friendly". In other words, make sure valid data has been entered. You are to create a simple change program. The user enters the amount due and the amount tendered. You are to calculate...

  • Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10...

    Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10 quarters, and 10 pennies. 2. Repeatedly prompt the user for a price in the form xX.xx, where X denotes a digit, or to enter q' to quit 3. When a price is entered a. If the price entered is negative, print an error message and start over requesting either a new price or to quit (indicated by entering a 'q)...

  • in C please! Proiect Overview: A business owner is unhappy with the services provided by the...

    in C please! Proiect Overview: A business owner is unhappy with the services provided by the government and has chosen to pay the tax using a combination of coins including quarters, dimes, nickels, and pennies. In this project, you are asked to write a program to analyze the tax payment in coins. Th nickels and pennies the owner has paid. It then computes the total amount of tax paid in dollars and cents, and computes the weight of all the...

  • Write a program that tells what coins to give out for as change from 1 cent...

    Write a program that tells what coins to give out for as change from 1 cent to 99 cents. Use coin denominations of 25 cents (quarters), 10 cents (dimes), and 1 cent (pennies) only. Include a loop that lets the user repeat this computation for new input values until the user says he or she wants to end the program. Solution Demo Hello I am the coin machine! I will give you the least number of coins for your change....

  • Please provide the full and correct solution to this problem. Make sure to provide comments so I can understand what is going on. Correct solution will receive thumbs up. Thanks. Write a program that...

    Please provide the full and correct solution to this problem. Make sure to provide comments so I can understand what is going on. Correct solution will receive thumbs up. Thanks. Write a program that generates an array filled up with random positive integer number ranging from 15 to 20, and display it on the screen. After the creation and displaying of the array, the program displays the following: [Plosition [RJeverse, [Ajverage, [SJearch, [Qjuit Please select an option: Then, if the...

  • Java programming. Please, could you add the comment so I can follow and understand. Thanks Create...

    Java programming. Please, could you add the comment so I can follow and understand. Thanks Create a program with JavaFX that displays a bouncing graphics (an image of a ball or the head of Darth Vader or anything else). The object should bounce around in the window. There should also be a button in the win- dow that releases another object (unlimited number should be possible to have in the window, but only one new object should be released for...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT