Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Main()
- Dim Reserve_Price() As Double = {799, 1200, 5000, 900, 500, 3202, 8000, 750, 980, 145}
- Dim Item_number() As Double = {895, 766, 454, 128, 362, 742, 255, 657, 157, 698}
- Dim Item_Description() As String = {"Swatch", "Tissot", "Rolex", "Tommy Helfieger", "Patek Phileppe", "Audemars Piguet", "Brietling", "Omega", "Gucci", "Louis Vutton"}
- Dim Number_bids() As Double = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
- Dim High_Bid() As Double = {661, 323, 877, 367, 15415, 600, 875, 450, 650, 1080}
- Dim Tot_items = 9
- Dim buyer_id(Tot_items) As Double
- Console.WriteLine("Item searching.......1 through item number.....2 through description.......any other digits to cancel searching")
- Dim search As Double = 0
- Dim search_itnum As Double = 0
- Dim search_itdes As String
- Dim found_num As Double = 0
- search = Console.ReadLine()
- Dim index As Double = 0
- If search = 1 Then
- Console.WriteLine("What is the item number?")
- search_itnum = Console.ReadLine()
- For index = 0 To Tot_items
- If search_itnum = Item_number(index) Then
- found_num = index
- Console.WriteLine(found_num & " " & Item_number(found_num) & " " & Item_Description(found_num) & " " & High_Bid(found_num) & " " & Number_bids(found_num))
- Console.WriteLine("Item has been found")
- End If
- Next
- ElseIf search = 2 Then
- Console.WriteLine("What is the item number?")
- search_itdes = Console.ReadLine()
- For index = 0 To Tot_items
- If search_itdes = Item_Description(index) Then
- found_num = index
- Console.WriteLine("Index number=" & found_num & " " & Item_number(found_num) & " " & Item_Description(found_num) & " " & High_Bid(found_num) & " " & Number_bids(found_num))
- Console.WriteLine("Item has been found")
- End If
- Next
- Else
- Console.WriteLine("Search Prevented")
- End If
- Dim input_user As Double = 0
- Dim user_price As Double = 0
- Do Until input_user = -1
- Console.WriteLine("Input the index number from the above searched or personally seen, a value of -1 will terminate the bidding process")
- input_user = Console.ReadLine()
- If input_user <> -1 Then
- Console.WriteLine("Item Description :" & Item_Description(input_user))
- Console.WriteLine("Item Number :" & Item_number(input_user))
- Console.WriteLine("Current Highest Bid =" & High_Bid(input_user) & " " & "Input a value higher to be accepted")
- Do Until user_price > High_Bid(input_user)
- Console.WriteLine("Input a greater price at which you are willing to bid")
- user_price = Console.ReadLine()
- Loop
- High_Bid(input_user) = user_price
- Console.WriteLine("Enter your Buyer ID")
- Number_bids(input_user) = Number_bids(input_user) + 1
- buyer_id(input_user) = Console.ReadLine
- Console.WriteLine("Happy Bidding!")
- End If
- Loop
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement