question archive Repeat Programming Project 10 of Chapter 2, but include input checking Display the change only if a valid price is entered (no less than 25 cents, no more than 100 cents, and an integer multiple of 5 cents)
Subject:Computer SciencePrice:2.89 Bought3
Repeat Programming Project 10 of Chapter 2, but include input checking Display the change only if a valid price is entered (no less than 25 cents, no more than 100 cents, and an integer multiple of 5 cents). Otherwise, display separate error messages for any of the following invalid inputs: a cost under 25 cents, a cost that is not an integer multiple of 5, and a cost that is more than a dollar.
Keep in if condition the constraints given .
If cents<=25 || cents >=100
To check the condition for multiple of 5 include this.
Take a number as input , and do loop keep k=5*n
See whether k%5=0
If zero then k is a multiple of 5 .
please see the attached file for the complete solution.