|
-
Oct 12th, 2003, 01:24 PM
#1
Thread Starter
New Member
Help with program vb.net
This is my program for school, I am new to vb.net and cannot get this to work for the life of me, can anyone help me. It is suppose to show how many quarters, dimes, nickels and pennies to hand back as change. Thank you in advance.
Module change1
Sub Main()
'declare variables
Dim change, price, num_qtrs, num_dimes, num_nickels, num_pennies, quarters, dimes, nickels, pennies As Integer
'populate variables
num_qtrs = 100 \ 25
num_dimes = 100 \ 10
num_nickels = 100 \ 5
num_pennies = 100 \ 1
Console.WriteLine("Welcome to the Change Calculator")
Console.WriteLine("You enter a price and I'll calculate the change")
Console.WriteLine("Are you ready to begin?")
Do While Console.ReadLine().ToUpper.Equals("YES")
'Prompt the user to enter a price
Console.WriteLine("Enter the price:")
' divide and dispay results
price = Convert.ToInt32(Console.ReadLine())
change = 100 - price
Console.WriteLine("change " & +change)
Console.WriteLine("quarters " & +quarters)
Console.WriteLine("dimes " & +dimes)
Console.WriteLine("nickels " & +nickels)
Console.WriteLine("pennies " & +pennies)
Console.WriteLine("Would you like to make more change?")
Console.WriteLine("GoodBye")
Loop
End Sub
End Module
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|