0% found this document useful (0 votes)
152 views14 pages

MOCK EXAM (Computer Science, p2, Class-11) 2023-24

the city school mock

Uploaded by

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

MOCK EXAM (Computer Science, p2, Class-11) 2023-24

the city school mock

Uploaded by

hijahkhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 14
She City School Mock Examination 2023-24 [student's Name Student ID Section Teacher's Name Campus Name COMPUTER SCIENCE 2210/22 CLASS 11 hour 45 minutes Paper 2 Algorithms, Programming and Logic You must answer on the question paper. No additional materials are needed INSTRUCTIONS Answer all questions. Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs. Write your Full Name, Student ID, Section, Subject Teacher’s Name and Campus Name in the boxes above. Write your answer to each question in the space provided. Do not use an erasable pen or correction fluid. Calculators must not be used in this paper. INFORMATION Invigilated by: Marked by: ‘Marks tallied by: The total mark for this paper is 75 The number of marks for each question or part question is shown in brackets [ J. No marks will be awarded for using brand names of software packages or hardware. he ity Steel] Urites Mock Examination, March 2026 / Computer Science P2/ Clas 33 This document has 14 pages. Page 1 of 14 1 An algorithm has been written in pseudocode to select a random number using the function Randint(n), which returns a whole number between 1 and the argument n. The algorithm then allows the user to guess the number. umber Randint(100) TotalTry ©1 REPEAT PRINT “Enter your guess now, it must be a whole number" INPUT Guess. IF TotalTry > Number THEN PRINT "Too large try again” ENDIF IF Guess > Number THEN PRINT "Too small try again" ENDIF TotalTry€ Guess +1 UNTIL Guess <> Number TotalTry€ TotalTry - 1 PRINT "Number of gues s", TotalTry Find the four errors in the pseudocode and suggest a correction to remove each error, Error 1.. Correction .. Error 3... Correction ... Error 4... Correction .. [4] of14 ‘te City Sebel} Voted Mock Examination, March 2024 / Computer Science P2/ 035521 Page 2. 2 Four descriptions and programming concepts are shown. Write the correct programming concept infront of the description, Library routine structure diagram procedure function (i) Asubroutine that may not return a value, standard subroutine that is available for immediate use, i (ii) A subroutine that can be used in an assignment statement. (iv) An overview of a program or subroutine. (4) Four stages of program development life cycle and four descriptions are shown. Draw line to link each stage to the most appropriate description. Each module of a program is written using a Design suitable programming language. ai Structure charts, flowcharts & pseudocodes are coe. made in this stage i The completed programs are now checked and Analysis run with different sets of data : The decomposition of the problem is done to Testing identify what is exactly required in the program. (4 puter cence F2/Class 33 Page 3 of 14 ty Sebel] Void Mock examination, March 2028 / C2 4 The table AUDIOPARTS stores the part number, description, cost and quantity in stock of the items sold by a music shop. Tower Speaker Skyscraper Cente Ssesker Soundbar Sounsbar Ceiling Surround Speaker ee Ceiling Full Range Speaker 400.00 1 | Sumound Speaker ~~~ 00.00 er Stands (Pat) 75.00 (a State the number of records in the table AUDIOPARTS [1] (0 Identify the field that is most suitable to be a primary key and give a reason for your choice Field name .. Reason Q] (c) Complete the structured query language (SQL) to return the quantity in stock fewer than 10. Show all the fields from the database table in descending order of cost. FROM WHERE Cost (5) ite ity hua Uri Mock Examination, March 202 / Computer Science F2/ 8822, Page 4 of 14 output of the mentioned query in part (¢): {d) Show th (3) 5 Programs can use both local and global variables. Describe the difference between local and global variables. ‘he Cty ‘ooo! tes Nore Examination, March 2026 [Computer Scence P2/Clats 12 Page Sof 14 6 program checks that the data entered is between 1 and 100 inclusive. Identify one piece of normal, extreme and erroneous test data for this program, and give a reason for each, Normal test data . Reason Extreme test data Reason ...... Erroneous test data Reason (6) woo [2] (b) Write pseudocode statements to store the word 'Test' in a new file 'MyFile.txt’. Foe iy Sohal] Soe Moc Examination, Mareh 202% / Computer Seance P2/ Cass 12 Page 6 of 14 @ (2). Draw flow chart for the program: ite 1 2 3 4 5 6 7 8 9 Initialise the variables where necessary, input a of number. Ifa Ois entered then goto step 8, count the numbers. calculate their total. find highest value. Go to step 2 calculate and out total and average output highest number 10 end the algorithm ‘iy bel} ote Moc Examination, March 20% [Compute Sclence 2 / Class 13, Page 7 of 14 (b) This flowchart inputs the weight of items in kilograms to be loaded on a trailer. Any item over 25 kilograms is rejected. The trailer can take up to 100 kilograms. "ART Totalweight <0 Reject —0 INPUT Weight Reject < Reject + 1 TotalWeight 100? TotalWeight

You might also like