I have been working on this for days. It works if you do add and subtract but i am suppose to use integer division and MOD and every different way I am doing it is not coming out with the right answer.
this is what my problem is..
Program: Suppose you can buy a chocolate bar from the vending machine for $1 each. Inside every chocolate bar is a coupon. You can redeem seven coupons for one chocolate bar from the machine. You would like to know how many chocolate bars you can eat, including from those redeemed via coupons, if you have n dollars.For example, if you have 20 dollars, then you can initially buy 20 chocolate bars. This gives you 20 coupons. You can redeem 14 coupons for two additional chocolate bars. These two additional chocolate bars give you two more coupons, so you now have a total of eight coupons. This gives you enough to redeem for one final chocolate bar. As a result you now have 23 chocolate bars and two leftover coupons.Also, for $50, you will get 58 chocolate bars and 2 coupons leftover.Write a program that inputs the number of dollars and outputs how many chocolate bars you can collect after spending all your money and redeeming as many coupons as possible. Also output the number of leftover coupons. The easiest way to solve this problem is to use a loop.Then, use a nested loop to ask if they would like to do this again. It should loop as many times as the user would like.
TEST DATA:
$20 gives 23 bars, 2 coupons
$50 gives 58 bars, 2 coupons
$11 gives 12 bars, 5 coupons
$6 gives 6 bars, 6 coupons

ok this is what I have:
Option Strict On
Option Explicit On

Module Module1



Sub Main()
' declare variable
Dim amountDollar As Integer
Dim totalCoupons As Integer
Dim leftOverCoupons As Integer
Dim numberofChocolate As Integer
Dim freeChocolate As Integer
Dim totalchocolate As Integer
Console.WriteLine("Please enter your amount here")
'begin outer loop for students
amountDollar = CInt(Console.ReadLine())
numberofChocolate = amountDollar
freeChocolate = CInt(numberofChocolate / 7)
totalchocolate = numberofChocolate + freeChocolate
Console.WriteLine("Total number of chocolate: " & totalchocolate)
leftOverCoupons = freeChocolate Mod numberofChocolate
Console.WriteLine("Leftover Coupons: " & leftOverCoupons)
amountDollar = CInt(numberofChocolate / 7)

Can someone please tell me what I am doing wrong Thanks for looking.Also all my work has to be done with visual basic console application.