You are to design and create a program that takes in a price from the user (as a decimal without a dollar sign) and determine the most efficient way to meet that price in bills and coins. Your program should use the following bills 100, 50, 20, 10, 5, and 1, it should also use the following coins: 25, 10, 5, 1. It can use some beyond these (such as a half dollar or two dollar bill) but it must have at least these currencies Your program should also be able to handle the instance in which a user enters in an invalid price gracefully without crashing.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Coded. 

 

 

Sample Executions:
(Price is valid)
Hello! Welcome to the currency calculator.
Enter in a valid price (in decimal) and we'1l tell you how much of each bill an
coin you'11 need to best meet that amount.
Enter in a price: 18.37
The paper bills you will need is:
O hundreds
O fifties
0 twenties
1 tens
1 fives
3 ones
The coins you will need is:
1 quarters
1 dimes
O nickels
2 pennies
(Incorrect price format)
Hello! Welcome to the arrency calculator.
Enter in a valid price (in decimal) and we'll tell you how much of each bil
coin you'11 need to best meet that amount
Enter in a price: hello
Transcribed Image Text:Sample Executions: (Price is valid) Hello! Welcome to the currency calculator. Enter in a valid price (in decimal) and we'1l tell you how much of each bill an coin you'11 need to best meet that amount. Enter in a price: 18.37 The paper bills you will need is: O hundreds O fifties 0 twenties 1 tens 1 fives 3 ones The coins you will need is: 1 quarters 1 dimes O nickels 2 pennies (Incorrect price format) Hello! Welcome to the arrency calculator. Enter in a valid price (in decimal) and we'll tell you how much of each bil coin you'11 need to best meet that amount Enter in a price: hello
VMICII Jatement.
You are to design and create a program that takes in a price from the user (as a decimal without
a dollar sign) and determine the most efficient way to meet that price in bills and coins. Your
program should use the following bills: 100, 50, 20, 10, 5, and 1, it should also use the following
coins: 25, 10, 5, 1. It can use some beyond these (such as a half dollar or two dollar bill) but it
must have at least these currencies.
Your program should also be able to handle the instance in which a user enters in an invalid
price gracefully without crashing.
Specifications:
Your program should use the following four functions:
• calcBills - calculates the number of each bill the price will require
• displayBills - displays how many of each bills the price will require (should not contain
any math)
calcCoins - calculates the number of each coin the price will require
displayCoins - displays how many of each coin the price will require (should not contain
any math)
The functions should follow the given function hierarchy chart
Main
Program
calcBills
calcCoins
displayBills
displayCoins
Transcribed Image Text:VMICII Jatement. You are to design and create a program that takes in a price from the user (as a decimal without a dollar sign) and determine the most efficient way to meet that price in bills and coins. Your program should use the following bills: 100, 50, 20, 10, 5, and 1, it should also use the following coins: 25, 10, 5, 1. It can use some beyond these (such as a half dollar or two dollar bill) but it must have at least these currencies. Your program should also be able to handle the instance in which a user enters in an invalid price gracefully without crashing. Specifications: Your program should use the following four functions: • calcBills - calculates the number of each bill the price will require • displayBills - displays how many of each bills the price will require (should not contain any math) calcCoins - calculates the number of each coin the price will require displayCoins - displays how many of each coin the price will require (should not contain any math) The functions should follow the given function hierarchy chart Main Program calcBills calcCoins displayBills displayCoins
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY