Pre-Release Booklet
Pre-Release Booklet
er
Science
Pre-
Release
2019
1
2
TASK 1 - Pseudocode
Const n= 10 // no. of items
WHILE n<10 do // Validation 1 on number of Items
Output “cannot have items less than 10, renter item numbers”
Input n
End While
DECLARE itemno[n] as String
DECLARE Desc[n] as String
DECLARE RP[n] as Integer or Real
DECLARE Bids[n] as Integer
For i <- 0 to n-1
OUTPUT “Enter the item number “
INPUT itemno[i]
For j <- 0 to i-1 // Validation2 on Item no. Unique Number
While( itemno[i] = itemno[j]) Do
OUTPUT “ Error, Duplicate Value, Enter Item No again”
INPUT itemno[i]
EndWhile
Next j
OUTPUT “Enter the description of the item “
INPUT Desc[i]
OUTPUT “Enter the Reserve Price “
INPUT RP[i]
While RP[i]<=0 do //Validation 3
Output “ Cannot be less than 0”
3
Input RP[i]
End While
Bids[i]<-0
Next i
4
Draw Flowchart of Task 1
5
TASK 2:
6
Pseudocode ( TASK 2):
Output “ How many Buyers in the auction”
Input No // INTEGER - Constant
DECLARE Buyerno[No] : String // DECLARE BuyerNo[0:No-1] as String
DECLARE HighestBids[n]: Integer
DECLARE record_buyer[n]: String
For I <- 0 to No-1
Buyerno[I] <- I+1
END FOR NEXT I
Auction<- “Y” // String
While (Auction=”Y”) Do
OUTPUT “ Enter the item Number, you want to Bid for”
INPUT X // STRING, Integer
For I<- 0 to N-1
IF X=itemno[I] then // Search
OUTPUT (“Item No”, itemno[I])
OUTPUT (“Description is “, DESC[I])
OUTPUT(“Highest Bid for this item is “, HighestBids[I])
OUTPUT (“Do you want to Bid for this item?(Y/N)”)
INPUT ans // CHAR
IF ans=’Y’ Then // Bid
OUTPUT ( “Enter the Bid”)
INPUT bid // Integer, REAL
IF bid > HighestBids[I] then // HighestBid
OUTPUT “ Bid Accepted”
7
OUTPUT “ enter the Buyer No”
INPUT B // INTEGER
HighestBids[I] = bid
Record_buyer[I]= B
Bids[I] = Bid[I]+1
END If // End of HighestBid
End IF // End of Bid
END IF // End of Search
For P<- 0 to N-1 // To display
OUTPUT “ Item No”, itemno[P]
OUTPUT “ Highest Bid”, HigestBids[P]
OUTPUT “ BuyerId with Highest Bid “, record_buyer[P]
OUTPUT “ No. of Bids”, Bids[P]
END FOR NEXT P
End FOR NEXT I
Output “ Do you want to continue?”
Input Auction
END While
8
Flow Chart (Task 2)
9
10
TASK 3:
11
Pseudocode:
12
Flowchart (Task 3):
13
Question Answers: (Refer TASK 1)
Q1 : Define constant. Identify all constants used in your program.
Q2 : Define variable. List three variables used in your program with their data
types and purpose.
Q3 : What is a data structure? List the data structure used in your program and
give one example.
14
Q4 : List the data type of all arrays used in Task 1. State why have you chosen
the listed data type.
Q5 b) What is an identifier?
15
(Refer TASK 2)
Q6 Write pseudocode to check whether the given buyer number exists or not.
16
Q9 What is the difference between counting and totaling? (Task 2 and Task 3)
17
Q12 Write any iteration and selection examples from the pseudocodes of Task1
and Task 2.
18
Q15 Write pseudocode to display all item numbers which are sold.
Q16 Write pseudocode to display item numbers, the highest bid and buyer
number of all sold items.
19
20