Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following question I need help with is below and is titled 7. Correct Change. Create a function in Python called GetChange that will accept

The following question I need help with is below and is titled "7. Correct Change."

Create a function in Python called GetChange that will accept the number of pennies, nickels, dimes and quarters. The function will then add up those values and check to see if the user has enough coins to make a whole dollar. If the user enters the right combination to make a dollar, have your function return the message CONGRATULATIONS. Otherwise return TRY AGAIN. Make sure your message is all in upper case.

For instance if the user enters the following:

  • pennies = 20
  • nickels = 5
  • dimes = 2
  • quarters = 1

Since this totals 85 cents, the message TRY AGAIN would be returned.

To test Codio will run your function. You do not need to write the code to run your function, unless your code does not pass the two tests. If your code does not pass the two tests, copy your code from Codio and paste it into either IDLE or VS Code. Then write the code to run your function to better debug and find out what is going on.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Is a bald man really hairless? Explain.

Answered: 1 week ago