1 Replies - 1395 Views - Last Post: 27 October 2009 - 11:30 AM Rate Topic: -----

#1 7714  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 22-September 09

Do While vb.net

Posted 27 October 2009 - 10:52 AM

Ok, so I'm writing a program where you have to enter the name, code, and money earned.

So for example:
You just enter a persons name other than "stop" and it gos onto enter code of person and money earned and it adds the money earned to the code and that's the total



This would be the money earned/code(But I don't know how to write it as a Do While Loop or would a select case be better
code = 1 so the program will do ( .01 * money earned +250) and that will be the total.
code = 2 so the program will do ( .04 * money earned +750) and that will be the total.
code = 0 or > than 2 program will do (.03 * money earned +600) and that will be the total.


Module Module1

	Sub Main()

		Dim Name As String
		Dim MoneyEarned As Decimal
		Dim Code As Decimal
		Dim Total As Decimal

		Console.WriteLine("Enter Persons name: ")
		Name = (Console.ReadLine)






	End Sub

End Module







Is This A Good Question/Topic? 0
  • +

Replies To: Do While vb.net

#2 MacAnimeGirl  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 282
  • Joined: 30-September 08

Re: Do While vb.net

Posted 27 October 2009 - 11:30 AM

I would say a select case but make sure you make allowances for times when people will enter a value that's more than 2.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1