1. Request a 3-digit integer from the console. Use division and modulo operations to extract each digit in reverse order. For each digit, determine if it is a factor of the original integer. Example Output (input in bold italics) Enter a 3-digit integer: 543 Is 3 a factor of 543? 1 Is 4 a factor of 543? 0 Is 5 a factor of 543? 0 2. Request a dollar amount as an integer (i.e. $5.43 is input as 543). If one were to convert this dollar amount into the smallest possible number of coins how many dimes would there be? Use division and modulo operations to code a solution for this problem given any dollar amount as input. Example Output (input in bold italics) Enter a dollar amount as an integer: 285 Optimal number of dimes: 1
1. Request a 3-digit integer from the console.
Use division and modulo operations to extract each digit in reverse order. For each digit, determine if it is a factor of the original integer.
Example Output (input in bold italics)
Enter a 3-digit integer: 543 Is 3 a factor of 543? 1
Is 4 a factor of 543? 0
Is 5 a factor of 543? 0
2. Request a dollar amount as an integer (i.e. $5.43 is input as 543).
If one were to convert this dollar amount into the smallest possible number of coins how many dimes would there be?
Use division and modulo operations to code a solution for this problem given any dollar amount as input.
Example Output (input in bold italics) Enter a dollar amount as an integer: 285
Optimal number of dimes: 1
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images