Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

New to VB

$
0
0
Hi, everyone I am very new to VB. I am actually a student in college right now. I have a question to ask, if anyone would be so kind to help I would greatly appriciate it.

I have an assignment for class in Intro to Programming. We are using VB to create this code in MS Visual Studio. I am creating a console application for this program.

I have created a lot of the program I am just stuck on the last bit of it. I will give you the problem in the text book, then I will post what code I have written so far. Thank you for all tips and suggestions.

The problem.

A customer in a store is purchasing five items. Design a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 6 percent.

The code I have so far.
vb.net Code:
  1. Module Module1
  2.  
  3.     Sub Main()
  4.         Console.Title = "Total Purchase"
  5.         Console.WriteLine("Input the amount of each item purchased")
  6.         Console.WriteLine("Item 1")
  7.         Dim Num1 As Double
  8.         Num1 = Console.ReadLine()
  9.         Console.WriteLine("Item 2")
  10.         Dim Num2 As Double
  11.         Num2 = Console.ReadLine()
  12.         Console.WriteLine("Item 3")
  13.         Dim Num3 As Double
  14.         Num3 = Console.ReadLine()
  15.         Console.WriteLine("Item 4")
  16.         Dim Num4 As Double
  17.         Num4 = Console.ReadLine()
  18.         Console.WriteLine("Item 5")
  19.         Dim Num5 As Double
  20.         Num5 = Console.ReadLine()
  21.         Console.WriteLine("Sub Total is")
  22.         Console.Write(Num1 + Num2 + Num3 + Num4 + Num5)
  23.         Console.ReadLine()
  24.         Dim Num6 As Double
  25.         Num6 =
  26.         Dim Tax As Double
  27.         Tax = 0.06
  28.         Console.WriteLine(Math.Round((Num1 + Num2 + Num3 + Num4 + Num5) * Tax, 3))
  29.         Console.ReadLine()
  30.     End Sub
Thank You so much for any help that you can give me.

Viewing all articles
Browse latest Browse all 27189

Trending Articles