T
The Retard Programmer
Guest
'This is what i have so far.. can someone help me how to total all the totalamounts if i press "N".. TY
Sub Main()
Dim customername, customeraddress, product As String
Dim keyboard, mouse, monitor, speaker, headphone, flashdrive, harddisk, videocard, graphicscard, CPU As Integer
Dim p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 As Double
Dim itemprice As Double
Dim quantity As Double
Dim totalamount As Double
p1 = 140
p2 = 135
p3 = 500
p4 = 250
p5 = 150
p6 = 600
p7 = 800
p8 = 1000
p9 = 1200
p10 = 1500
keyboard = p1
mouse = p2
monitor = p3
speaker = p4
headphone = p5
flashdrive = p6
harddisk = p7
videocard = p8
graphicscard = p9
CPU = p10
Console.WriteLine("Welcome!")
Console.WriteLine()
Console.WriteLine("--------------------------------------------------------------------")
Console.WriteLine("InJoker")
Console.WriteLine("Naval, Biliran")
Console.WriteLine("500-9000")
Console.WriteLine()
Console.WriteLine("--------------------------------------------------------------------")
Console.Write("Date: ")
Console.ReadLine()
Console.WriteLine()
Console.WriteLine("Keyboard: {0}", p1)
Console.WriteLine("Mouse: {0}", p2)
Console.WriteLine("Monitor: {0}", p3)
Console.WriteLine("Speaker: {0} ", p4)
Console.WriteLine("Headphone: {0}",p5)
Console.WriteLine("Flashdrive: {0}", p6)
Console.WriteLine("Hard Disck: {0}", p7)
Console.WriteLine("Video Card: {0}", p8)
Console.WriteLine("Graphics Card: {0}", p9)
Console.WriteLine("CPU: {0}", p10)
Console.WriteLine()
Console.WriteLine("--------------------------------------------------------------------")
Console.Write("Please enter Customer Name: ")
customername = Console.ReadLine
Console.Write("Please enter Customer Address: ")
customeraddress = Console.ReadLine
Console.Write("Please select a Product: ")
product = Console.ReadLine
Console.Write("Item Price: ")
itemprice = Console.ReadLine
Console.Write("Quantity: ")
quantity = Console.ReadLine
totalamount = itemprice * quantity
Console.WriteLine()
Console.WriteLine("Customer Name: {0}", customername)
Console.WriteLine("Customer Address: {0}", customeraddress)
Console.WriteLine("Product: {0}", product)
Console.WriteLine("Quantity: {0}", quantity)
Console.WriteLine("Total Amount: {0}", totalamount)
Console.WriteLine()
Dim choice As String
Console.Write("Would you like to select another product? (Y/N)? ")
choice = Console.ReadLine
If choice = "N" Then
Console.WriteLine("Totalamount: {0}", totalamount)
ElseIf choice = "Y" Then
Do
Console.WriteLine()
Console.Write("Would you like to select another product? (Y/N)? ")
choice = Console.ReadLine()
Console.WriteLine("--------------------------------------------------------------------")
If choice = "N" Then
Console.WriteLine("Totalamount: {0}", totalamount)
End If
Console.WriteLine()
Console.Write("Please select a Product: ")
product = Console.ReadLine
Console.Write("Item Price: ")
itemprice = Console.ReadLine
Console.Write("Quantity: ")
quantity = Console.ReadLine
totalamount = itemprice * quantity
Console.WriteLine()
Console.WriteLine("Customer Name: {0}", customername)
Console.WriteLine("Customer Address: {0}", customeraddress)
Console.WriteLine("Product: {0}", product)
Console.WriteLine("Quantity: {0}", quantity)
Console.WriteLine("Total Amount: {0}", totalamount)
Loop While choice <> "N"
End If
Console.ReadKey()
End Sub
Continue reading...
Sub Main()
Dim customername, customeraddress, product As String
Dim keyboard, mouse, monitor, speaker, headphone, flashdrive, harddisk, videocard, graphicscard, CPU As Integer
Dim p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 As Double
Dim itemprice As Double
Dim quantity As Double
Dim totalamount As Double
p1 = 140
p2 = 135
p3 = 500
p4 = 250
p5 = 150
p6 = 600
p7 = 800
p8 = 1000
p9 = 1200
p10 = 1500
keyboard = p1
mouse = p2
monitor = p3
speaker = p4
headphone = p5
flashdrive = p6
harddisk = p7
videocard = p8
graphicscard = p9
CPU = p10
Console.WriteLine("Welcome!")
Console.WriteLine()
Console.WriteLine("--------------------------------------------------------------------")
Console.WriteLine("InJoker")
Console.WriteLine("Naval, Biliran")
Console.WriteLine("500-9000")
Console.WriteLine()
Console.WriteLine("--------------------------------------------------------------------")
Console.Write("Date: ")
Console.ReadLine()
Console.WriteLine()
Console.WriteLine("Keyboard: {0}", p1)
Console.WriteLine("Mouse: {0}", p2)
Console.WriteLine("Monitor: {0}", p3)
Console.WriteLine("Speaker: {0} ", p4)
Console.WriteLine("Headphone: {0}",p5)
Console.WriteLine("Flashdrive: {0}", p6)
Console.WriteLine("Hard Disck: {0}", p7)
Console.WriteLine("Video Card: {0}", p8)
Console.WriteLine("Graphics Card: {0}", p9)
Console.WriteLine("CPU: {0}", p10)
Console.WriteLine()
Console.WriteLine("--------------------------------------------------------------------")
Console.Write("Please enter Customer Name: ")
customername = Console.ReadLine
Console.Write("Please enter Customer Address: ")
customeraddress = Console.ReadLine
Console.Write("Please select a Product: ")
product = Console.ReadLine
Console.Write("Item Price: ")
itemprice = Console.ReadLine
Console.Write("Quantity: ")
quantity = Console.ReadLine
totalamount = itemprice * quantity
Console.WriteLine()
Console.WriteLine("Customer Name: {0}", customername)
Console.WriteLine("Customer Address: {0}", customeraddress)
Console.WriteLine("Product: {0}", product)
Console.WriteLine("Quantity: {0}", quantity)
Console.WriteLine("Total Amount: {0}", totalamount)
Console.WriteLine()
Dim choice As String
Console.Write("Would you like to select another product? (Y/N)? ")
choice = Console.ReadLine
If choice = "N" Then
Console.WriteLine("Totalamount: {0}", totalamount)
ElseIf choice = "Y" Then
Do
Console.WriteLine()
Console.Write("Would you like to select another product? (Y/N)? ")
choice = Console.ReadLine()
Console.WriteLine("--------------------------------------------------------------------")
If choice = "N" Then
Console.WriteLine("Totalamount: {0}", totalamount)
End If
Console.WriteLine()
Console.Write("Please select a Product: ")
product = Console.ReadLine
Console.Write("Item Price: ")
itemprice = Console.ReadLine
Console.Write("Quantity: ")
quantity = Console.ReadLine
totalamount = itemprice * quantity
Console.WriteLine()
Console.WriteLine("Customer Name: {0}", customername)
Console.WriteLine("Customer Address: {0}", customeraddress)
Console.WriteLine("Product: {0}", product)
Console.WriteLine("Quantity: {0}", quantity)
Console.WriteLine("Total Amount: {0}", totalamount)
Loop While choice <> "N"
End If
Console.ReadKey()
End Sub
Continue reading...