如果我把console.writeline(sale)放在那裏,那麼我需要在代碼中輸入什麼才能獲得答案,顯示在程序的股票訂單部分中在一件事情表明,即使我已經輸入了多個東西出售,所以我如何保存以前的交易顯示在最後,即股票訂單部分,我認爲這是與櫃檯做的事情,但現在基本上需要知道如何保存以前輸入的信息顯示在最後。控制檯應用程序VB,在所有頁面上顯示答案時都需要幫助
子的Main()
Dim start As String
Dim Sale As String
Dim Receipt As String
Dim endProgram As String
Dim StockOrder As New list(Of String)
Console.WriteLine("Welcome, Let's start today's sales")
Console.WriteLine()
Console.WriteLine("please type 'Yes' or 'No', Yes to Start and No to Stop")
start = Console.ReadLine()
Do
If (start = "Yes") Then
Console.WriteLine("What have you sold today? and for how much? and Please input Code on the side of the item")
Sale = Console.ReadLine
StockOrder.Add(Console.ReadLine)
Console.Clear()
Console.WriteLine()
Console.WriteLine("Customer Receipt")
Console.WriteLine()
Console.WriteLine(Sale)
Console.WriteLine()
Console.WriteLine("Dear customer thank you for shopping with us, we appreciated your custom. please note that we have a 14 day return policy in which you can return faulty or unused and unopened items, if any product is returned without any fault please know that a 25% handling fee may apply, for any repair you have a three month warranty, this warranty only includes fault with the item replaced and any additional faults that occur will not be our responsibility.")
Receipt = Console.ReadLine
Console.Clear()
Console.WriteLine()
Console.WriteLine()
Console.WriteLine("Would You Like to Continue?")
start = Console.ReadLine
If (start = "No") Then
Console.Clear()
Console.WriteLine("Stock Order and Sales Sheet")
Console.WriteLine()
Console.Write(String.Join(Environment.NewLine, StockOrder))
For i = 0 To StockOrder.Count - 1
Console.WriteLine(StockOrder(i))
Next
End If
ElseIf (start = "No") Then
Console.WriteLine("Since you don't want to use the program nothing else will be ordered in the stock order")
Console.WriteLine("Thank you for using this program")
endProgram = Console.ReadLine
End
End If
Loop
End Sub
前端模塊
你在問什麼?此外,代碼不會編譯; 'StockOrder ='。 'StockOrder'的價值是什麼? –
什麼是'銷售'的數據類型 – CurseStacker
股票訂單沒有價值,當我運行程序沒有股票訂單它運行良好我唯一的問題是將先前輸入的信息保存到一個頁面,所以如果我有多個銷售,我只收到我輸入的最近的東西的股票訂單,我需要它爲我添加的所有東西添加, –