0% found this document useful (0 votes)
38 views2 pages

Itemno (Count) Count Totalbids (Count) 0 Description (Count) " "

The document declares variables to store details of auction items, including item numbers, descriptions, reserve prices, and bids. It then collects this data through a user input loop, validating that descriptions are provided. Another loop checks the highest bids against reserve prices to determine if items sold, and calculates fees and statistics.

Uploaded by

sherjeel shahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Itemno (Count) Count Totalbids (Count) 0 Description (Count) " "

The document declares variables to store details of auction items, including item numbers, descriptions, reserve prices, and bids. It then collects this data through a user input loop, validating that descriptions are provided. Another loop checks the highest bids against reserve prices to determine if items sold, and calculates fees and statistics.

Uploaded by

sherjeel shahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

BEGIN

CONST maxitems 10 AS INTEGER


DECLARE itemno [1:10] , totalbids [1:10], count 0 AS INTEGER
DECLARE description [1:10] AS STRING
DECLARE reserveprice [1:10] ASFLOAT

FOR count 1 TO maxitems


itemno[count] count
totalbids[count] 0
description[count] ““

PRINT “Enter details for item number” , count


INPUT “Enter description”, description[count]
IF description[count] = “ “ THEN
PRINT “Enter reserve price” , reserveprice[count]
END IF
INPUT “Enter reserve price” , reserveprice[count]
IF reserveprice[count] < 0 THEN
PRINT “Error. Description cannot be left blank”
END IF
NEXT count

BEGIN
DECLARE sold[1:10] AS BOOLEAN
DECLARE auctionfee 0.00 AS FLOAT
DECLARE totalsold 0, totalunsold 0, nobids 0 AS INTEGER

FOR count 1 TO maxitems


IF highestbid[count] > reserveprice[count] THEN
sold[count] true
totalsold totalsold + 1
auctionfee auctionfee + (highestbid[count] * 0.1)
ELSE IF totalbids[count] > 0 THEN
sold[count] false
totalunsold totalunsold + 1
PRINT “Item number” , itemno[count], “didn’t reach reserve price”
PRINT “Final bid” , highestbid[count]
ELSE
sold[count] false
nobids +1
PRINT “Item number” , itemno[count], “received no bids”
END IF
NEXT count
PRINT “Total auction company fee is:”, auctionfee
PRINT “Total sold items are:”, totalsold
PRINT “Total unsold items are:” total unsold
PRINT “Total items without any bids are:”, nobids
END

You might also like