I am writing a code for an online store. It's a school assignment. Here are the conditions and price:
Each DVD is $20.00
Every 6th DVD purchased is free. That is, for every 5 DVDs that you buy, you get an extra 1 free. For example, 5 or 6 DVDs would be the same price of $100.00 and 11 or 12 DVDs would be the same price of $200.00.
I have tried for several hours but cannot come up with a code that meets these requirements. I would really appreciate if someone helped me. Thanks in advance!
i havent come up with anything yet. Im trying to put an if statement in before the piece of code Niven suggested. So it should be if the the num of DVDs the customer buys give him one free dvd for every 5 he has. and if he enters 10, the 6th one in that should automatically be free. I dont know what to do :/