Today’s challenge will be easy procedure (again ).
A shop is doing a promotion on an item with the price of $a. Every x item bought, the total price not including the remainder* will reduce by y%. But there is a limit. The reduction can’t be higher than z%. You are gonna buy n item.
*If there is remainder, the remain items will not have reduction. (like when you buy 7 items but only every 3 items, only 6 items prices will be reduced.)
Your task is to return the percentage reduced, and how much is needed to pay.
5 inputs in total
For example,
Input: a=10, x=2, y=5, z=50, n=12
Output:
The percentage reduced: 30% off
Money needed to pay: $84
Input: a=8.1, x=3, y=7, z=20, n=15
Output:
The percentage reduced: 20%
Money needed to pay: 97.2
You give me an idea of the next challenge.
But I think I will wait a few days, cuz these days it is just me to make challenges.
Maybe @dora_paz you can try to make one