i dont understand what is wrong with my code, can someone please help me please???? im using python3 (default template a

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

i dont understand what is wrong with my code, can someone please help me please???? im using python3 (default template a

Post by answerhappygod »

i dont understand what is wrong with my code, can someone please
help me please???? im using python3 (default template also
below)
I Dont Understand What Is Wrong With My Code Can Someone Please Help Me Please Im Using Python3 Default Template A 1
I Dont Understand What Is Wrong With My Code Can Someone Please Help Me Please Im Using Python3 Default Template A 1 (32.72 KiB) Viewed 23 times
I Dont Understand What Is Wrong With My Code Can Someone Please Help Me Please Im Using Python3 Default Template A 2
I Dont Understand What Is Wrong With My Code Can Someone Please Help Me Please Im Using Python3 Default Template A 2 (60.79 KiB) Viewed 23 times
I Dont Understand What Is Wrong With My Code Can Someone Please Help Me Please Im Using Python3 Default Template A 3
I Dont Understand What Is Wrong With My Code Can Someone Please Help Me Please Im Using Python3 Default Template A 3 (38.43 KiB) Viewed 23 times
DEFAULT TEMPLATE:
I Dont Understand What Is Wrong With My Code Can Someone Please Help Me Please Im Using Python3 Default Template A 4
I Dont Understand What Is Wrong With My Code Can Someone Please Help Me Please Im Using Python3 Default Template A 4 (22.19 KiB) Viewed 23 times
Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 or less, the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes Your program must define and call the following function. The function exact_change() should return num_dollars, num_quarters, num_dimes, num_nickels, and num_pennies. def exact_change (user_total)

1 def exact_change (user_total): 2 dollars = user_total // 100 user_total % - 100 quarters = user_total // 25 user_total %= 25 dimes = user total // 10 user total % - 10 nickels = user_total // 5 user_total %= 5 10 pennies = user_total 11 return dollars, quarters, dimes, nickels, pennies 12 13 if _name__ == ' _main__': 14 input_valint (input()) 15 num_dollars, num_quarters, num_dimes, num_nickels, num_pennies = exact_change (input_val) 16 17 18 def main(): 19 input_valint (input()) 20 num_dollars, num_quarters, num_dimes, num_nickels, num_pennies = exact_change (input_val) if input_val <= 0: 21 22 print('no change') 23 else: 24 if num_dollars > 1: 25 print('%d dollars' % num_dollars) 26 elif num_dollars == 1: 27 print('%d dollar' num_dollars) 28 29 if num_quarters > 1: 30 print('%d quarters' % num_quarters) 31 elif num_quarters == 1: 32 print('%d quarter' % num quarters) ▬▬ 3 4 5 6 7 8 9

18 def main(): 19 input_valint (input()) 20 num_dollars, num_quarters, num_dimes, num_nickels, num_pennies = exact_change (input_val) if input_val <= 0: 21 22 print('no change') 23 else: 24 if num_dollars > 1: 25 print('%d dollars' % num_dollars) 26 elif num_dollars == 1: 27 print('%d dollar' % num_dollars) 28 29 if num_quarters > 1: 30 print('%d quarters' % num_quarters) elif num_quarters == 1: 31 32 print('%d quarter' % num_quarters) 33 34 if num dimes > 1: 35 print('%d dimes' % num_dimes) 36 elif num_dimes == 1: 37 print('%d dime' % num_dimes) 38 39 if num_nickels > 1: 40 print('%d nickels' % num_nickels) elif num_nickels == 1: 41 42 print('%d nickel' % num_nickels) 43 44 if num_pennies > 1: 45 print('%d pennies' % num_pennies) elif num_pennies == 1: 46 47 print('%d penny' % num_pennies) 48

LAB 5.19.1: LAB: Exact change - functions ACTIVITY main.py 1 # Define your function here 2 ' 3 if _name__ == _main__': 4 input_valint (input()) num_dollars, num_quarters, num_dimes, num_nickels, num_pennies = exact_change (input_val) # Type your code here. 8 0/10 Load default template...
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply