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.
Thank You so much for any help that you can give me.
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:
Module Module1 Sub Main() Console.Title = "Total Purchase" Console.WriteLine("Input the amount of each item purchased") Console.WriteLine("Item 1") Dim Num1 As Double Num1 = Console.ReadLine() Console.WriteLine("Item 2") Dim Num2 As Double Num2 = Console.ReadLine() Console.WriteLine("Item 3") Dim Num3 As Double Num3 = Console.ReadLine() Console.WriteLine("Item 4") Dim Num4 As Double Num4 = Console.ReadLine() Console.WriteLine("Item 5") Dim Num5 As Double Num5 = Console.ReadLine() Console.WriteLine("Sub Total is") Console.Write(Num1 + Num2 + Num3 + Num4 + Num5) Console.ReadLine() Dim Num6 As Double Num6 = Dim Tax As Double Tax = 0.06 Console.WriteLine(Math.Round((Num1 + Num2 + Num3 + Num4 + Num5) * Tax, 3)) Console.ReadLine() End Sub