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

Pre Release Solution MAY/JUNE 2019: Computer Science Made Easy

The document contains pseudocode that calculates various metrics from an auction. It initializes variables like an array to track whether each item was sold, and totals to track company fees and unsold items. It then loops through each item, calculates the company's 10% fee for sold items, and counts items unsold due to low bids or no bids. Finally it outputs the total fees, counts of unsold items, and items sold.

Uploaded by

Faizan Majid
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)
15 views2 pages

Pre Release Solution MAY/JUNE 2019: Computer Science Made Easy

The document contains pseudocode that calculates various metrics from an auction. It initializes variables like an array to track whether each item was sold, and totals to track company fees and unsold items. It then loops through each item, calculates the company's 10% fee for sold items, and counts items unsold due to low bids or no bids. Finally it outputs the total fees, counts of unsold items, and items sold.

Uploaded by

Faizan Majid
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

PRE RELEASE SOLUTION

PRM MAY/JUNE 2019

DECLARE sold[1 TO totalItems] : BOOLEAN


DECLARE lessThanReserve : INTEGER
DECLARE noBid : INTEGER
DECLARE companyTotal: REAL
DECLARE soldItems : INTEGER

companyTotal0.0
FOR count 1 TO totalItems
Sold[count]false
NEXT

FOR count 1 TO totalItems


IF highestBidSoFar[count] > reservePrice[count] THEN
sold[count] True
ENDIF
NEXT

FOR count 1 TO totalItems

//Company’s 10% calculated

IF sold[count] = True THEN


companyTotal companyTotal + highestBidSoFar[count]*0.1)
soldItems soldItems + 1
ENDIF
NEXT
OUTPUT “total fee for all sold items”, companyTotal

OUTPUT “Items that haven’t reached their reserved price”


FOR count 1 TO totalItems

IF highestBidSoFar[count] < reservePrice[count] THEN


OUTPUT itemNumber[count]; highestBidSoFar[count]
lessThanReserve  lessThanReserve + 1
ENDIF

NEXT

Computer Science Made Easy

By Shahzadah Ashraf Bandeshah yousufmateen.com


PRE RELEASE SOLUTION
PRM MAY/JUNE 2019

OUTPUT “Items that haven’t received 1 bid”

FOR count 1 TO totalItems


IF noOfBids[count] = 0 THEN
OUTPUT itemNumber[count]
noBidnoBid+1
ENDIF
NEXT

OUTPUT “Total Items sold”;soldItems


OUTPUT “Total of these: ”; lessThanReserve
OUTPUT “Total of these:”; noBid

Computer Science Made Easy

By Shahzadah Ashraf Bandeshah yousufmateen.com

You might also like