Question

In: Computer Science

Phyton Please!! Make a program where you enter a dollar amount and the program tells you...

Phyton Please!!

Make a program where you enter a dollar amount and the program tells you how many $5 bills and $1 bills you will receive. Don’t use a dollar amount that equality of 5.

Example:

Enter Amount: (user inserts value)

Amount Entered: $50.00

5 dollar bills: 5

1 dollar bills: 25

Solutions

Expert Solution

amount = int(input('Enter Amount: '))

fiveDollarAmount =amount // 2
oneDollarAmount = amount - fiveDollarAmount
while fiveDollarAmount % 5 != 0:
        fiveDollarAmount -= 1
        oneDollarAmount += 1

print('Amount entered: $%.2f' % amount)
print('5 dollar bills: $%.2f' % (fiveDollarAmount/5))
print('1 dollar bills: $%.2f' % (oneDollarAmount))
**************************************************

Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.

Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.


Related Solutions

Using Java! Write a program that ask prompt the user to enter a dollar amount as...
Using Java! Write a program that ask prompt the user to enter a dollar amount as double. Then, calculate how many quarters, dimes, nickels and pennies are in the dollar amount. For example: $2.56 = 10 quarters, 1 dime, 1 nickel and 1 cent. Print all of the values. Hint: Use Modulus operator and integer division when necessary.
Please use Phyton to write a program: Write a program that calculates and displays the total...
Please use Phyton to write a program: Write a program that calculates and displays the total bill at a restaurant for a couple that is dining. The program should collect from the couple, cost of each meal, and the percentage of the final cost that they would like to tip. The sales tax in the state where the restaurant exists is 7.5%. Display to the user, line by line: Total Cost of Both Meals Sales Tax in dollars Tip in...
I am trying to make a program in Python that opens a file and tells you...
I am trying to make a program in Python that opens a file and tells you how many lines, vowels, consonants, and digits there are in the file. I got the print out of lines, digits, and consonants, but the if statement I made with the vowels list isn't recognizing them. How can I make the vowels go through the if statement with the list? Am I using the wrong operator? Here is my program #Assignment Ch7-1 #This program takes...
Problem 1 Write a program that prompts the user to enter an integer It then tells...
Problem 1 Write a program that prompts the user to enter an integer It then tells the user if the integers is a multiple of 2, 3, 5, 7 or none of the above. Program language is C Ex. Enter an integer 12 You entered 12 The number you entered is a multiple of 2 ----------------------------------------------- Enter an integer 11 You entered 11 The number you entered is not a multiple of 2, 3, 5, or 7
Write a Python program that reads in an amount in cents and prints the dollar amount...
Write a Python program that reads in an amount in cents and prints the dollar amount in that and the remaining value in cents. For example, if the amount reads in is 360 (cents), the program would print 3 dollars and 60 cents. if the amount read in is 75 (cents), the program would print 0 dollars and 75 cents.
How to create a program Budget Enter the amount budgeted for the month: 400 Enter the...
How to create a program Budget Enter the amount budgeted for the month: 400 Enter the expense (-1 to quite):100 Enter the expense (-1 to quite):-1 $400 budgeted. 1 expenses totaling $100. $300 under budget. Need to use sentinel value of -1, while loop
Write a program that will ask the user to enter the amount of a purchase. The...
Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 5 percent and the county sales tax is 2.5 percent. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of purchase plus the...
Please make a Python program where the computer chooses a number and the player guesses the...
Please make a Python program where the computer chooses a number and the player guesses the number. You need an input, a random number, if statement, and a while loop. Please reference these when doing the code: ((random reference)) •>>> import random •>>> random.randint(1, 100) •67 ((While & if referefence)) •>>> cnum = 3 •>>>while true •>>> if cnum == 3: •>>> print(‘correct’) •>>> break •>>> elif cnum == 2: •>>> print(‘incorrect’) Please post the Python code and the screen...
Please make a Python program where the computer chooses a number and the player guesses the...
Please make a Python program where the computer chooses a number and the player guesses the number. You need an input, a random number, if statement, and a while loop. Please reference these when doing the code: ((random reference)) •>>> import random •>>> random.randint(1, 100) •67 ((While & if referefence)) •>>> cnum = 3 •>>>while true •>>> if cnum == 3: •>>> print(‘correct’) •>>> break •>>> elif cnum == 2: •>>> print(‘incorrect’) Please prepare a Word document that has the...
This phyton program requires you to prints out the total of a series of positive floating-pointnumbers...
This phyton program requires you to prints out the total of a series of positive floating-pointnumbers entered by the user. The user should be prompted with the message "Enter a floating-point number >= 0:". You do not need to check that the input is a FP number. If the user correctly enters a positive FP number, handle it and prompt the user for the next number with the same message. If the user enters a negative number, your program should...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT