1 Replies - 284 Views - Last Post: 20 May 2019 - 01:42 AM Rate Topic: -----

#1 malikirtixa   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-May 19

Pseudo code for auction company

Posted 19 May 2019 - 10:25 AM

Hey everyone. I've written a Pseudo code for a an auction company and im not if its gonna work effectively or not and i can't catch the mistakes, so if anyone can help me catch problems, it would be a world to me. (The boxes are arrows used for assigning a value)


1. INT Total_items  0
2. INT Item_Number  0
3. CHAR Description  ” “
4. INT Reserve_Price  0
5. INT Buyer_ID  0
6. INT Indicator  0
7. INT User_BID  0
8. BOOL YesNo  True/False
9. BOOL Any_More_Bidders  True/False
10. INT Total_items_sold  0
11. INT Fee  0
12. INT Total_Fee  0
13. INT Total_items_Unsold  0
14. INT No_Bid_Items  0
15. Output (“Total items for auction?”)
16. Input Total_items
17. Repeat
18. If Total_items < 10, then
19. Output ( “ Total items must be at least 10, please input again”)
20. Input Total_items
21. Until Total_items >= 10
22. DIM INT Item_number (1: Total_items)  0
23. DIM CHAR Description (1: Total_items)  0
24. DIM INT Reserve_price (1: Total_items)  0
25. DIM INT Number_Of_Bids (1: Total_items)  0
26. DIM INT Current_Highest_Bid (1: Total_items)  0
27. DIM BOOL Items_Sold (1: Total_items)  0
28. For count  1 to Total_items
29. Input Item_number
30. Item_number (count)  Item_Number
31. Input Description
32. Description (count)  Description
33. Input Reserve_price
34. Reserve_price (count)  Reserve_price
35. Number_Of_Bids (count)  0
36. Current_Highest_Bid (count)  0
37. Next
38. Repeat
39. For count  1 to Total_items
40. Output ( “ The item number “ & Item_Number (count) “ is a/an “ & description (count) “ with the highest current bid of “ & Current_Highest_Bid (count) )
41. Next
42. Repeat
43. Output ( “ Enter your Buyer ID please”)
44. Input Buyer_ID
45. Output ( “ Enter the Item Number please” )
46. Input Item_number
47. For count  1 to Total_items
48. If Item_number = Item_Number (count), then
49. Indicator  count
50. End if
51. Next
52. Output ( “ The item number “ & Item_Number (indicator) “ is a/an “ & description (indicator) “ with the highest current bid of “ & Current_Highest_Bid (indicator) )
53. Output (“please enter your bid for this item”)
54. Input User_BID
55. If User_BID > Current_Highest_Bid (Indicator), then
56. Current_Highest_Bid (Indicator)  User_BID
57. Number_Of_Bids (Indicator)  Number_Of_Bids (Indicator) + 1
58. Output ( “Your Bid stands recorded”)
59. Else
60. Output (“Your bid cannot be accepted as it is lower or equal to the Highest bid for this item”)
61. End if
62. End if
63. Output (“Do you wish to Bid again? Press Y for TRUE and N for FALSE”)
64. Input YesNo
65. UNTIL YesNo = FALSE
66. Output (“Are there anymore bidders? Y for TRUE, N for FALSE”)
67. Input Any_More_Bidders
68. UNTIL Any_More_Bidders = FALSE
69. For count  1 to Total_items
70. If Current_Highest_Bid (count) > Reserve_Price (count), then
71. Items_Sold ( count)  TRUE
72. Total_items_sold  Total_items_Sold + 1
73. Fee  Current_Highest_Bid (Count) * 0.1
74. Total_Fee = Total_Fee + fee
75. Else If Current_Highest_Bid (count) <= Reserve_Price (count), then
76. Items_Sold (count)  FALSE
77. Total_items_Unsold  Total_items_Unsold + 1
78. End if
79. End if
80. Next
81. Output ( ‘’The total fee generated through the auction is: ‘’ & Total_Fee)
82. For count  1 to Total_items
83. If Items_Sold (count) = FALSE , then
84. Output ( “The item number” & Item_Number (count) “ has not reached the reserved price and its final bid is” & Current_Highest_Bid (Count) )
85. End if
86. Next
87. For count = 1 to Total_items
88. If Number_Of_Bids(count) = 0, then
89. Output (“ The item with the item number: “ & Item_number (Count) “ has received no bids”)
90. No_Bid_Items  No_Bid_Items + 1
91. End if
92. Next
93. Output (“The number of items sold are: “ & Total_items_sold”
94. Output (“ The number of items not sold are: “ & Total_items_Unsold)
95. Output ( “ The number of items which received no bids are: “ & No_Bid_Items )

Any help would be appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Pseudo code for auction company

#2 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6819
  • View blog
  • Posts: 28,247
  • Joined: 12-December 12

Re: Pseudo code for auction company

Posted 20 May 2019 - 01:42 AM

I would not call that pseudo-code, it is next door to code. In fact, it is so close to code (VB? Pascal?) that you might as well enter and complete it in your editor and try and run it.

Pseudo-code should be shorter; should include comments to outline the flow and logic; and should have more comments than variable declarations. Use indenting to emphasise the flow.

If you want to revise and resubmit it here with these changes, including an initial description of what the code, overall, is supposed to do, you are more likely to receive some assistance.



To emphasise, this is not pseudo-code and, if your assignment is to provide pseudo-code, then I encourage you to edit it in-line with my suggestions. Start with a basic description of what the program is supposed to do, then refine it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1