Write a modular solution (C program) that will accept as input an amount of money (in cents) in a certain currency and return the optimal number of coins in that currency. The amount of money entered in is in cents and should be an integer value in the range of 1 to 95 inclusive. The program should work as follows; First, it will ask the user to select a currency among the following three: US$, which has four types of coins: 50, 25, 10 and 1 cents AU$, which has four types of coins: 50, 20, 10 and 5 cents Euro, which has four types of coins: 20, 10, 5 and 1 cents It should ask the user to input an amount in cents as a number between 1 to 95 inclusive. If the chosen currency is AU$, your program should ensure that the input value is a multiples of 5. Your program should then return the minimum number of coins (in the selected currency) that sum up into that number. For example, a poor solution for an input of 30 cents would give six 5 cent coins. A correct solution would give a 20 cent coin and a 10 cent coin. After each output, the user should be asked whether they wish to continue (i.e., enter another amount) or exit/ terminate the program. Your solution (algorithm and program) should be designed using a modular approach. **Important Note: For this problem, the principles of code reuse, low coupling and high cohesion, are particularly important. 8:07 PM
Write a modular solution (C program) that will accept as input an amount of money (in cents) in a certain currency and return the optimal number of coins in that currency. The amount of money entered in is in cents and should be an integer value in the range of 1 to 95 inclusive. The program should work as follows; First, it will ask the user to select a currency among the following three: US$, which has four types of coins: 50, 25, 10 and 1 cents AU$, which has four types of coins: 50, 20, 10 and 5 cents Euro, which has four types of coins: 20, 10, 5 and 1 cents It should ask the user to input an amount in cents as a number between 1 to 95 inclusive. If the chosen currency is AU$, your program should ensure that the input value is a multiples of 5. Your program should then return the minimum number of coins (in the selected currency) that sum up into that number. For example, a poor solution for an input of 30 cents would give six 5 cent coins. A correct solution would give a 20 cent coin and a 10 cent coin. After each output, the user should be asked whether they wish to continue (i.e., enter another amount) or exit/ terminate the program. Your solution (algorithm and program) should be designed using a modular approach. **Important Note: For this problem, the principles of code reuse, low coupling and high cohesion, are particularly important. 8:07 PM
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 3 images