You are on page 1of 11
ET 7 Tick (7) one box to identify the fst stage ofthe program development if cycle. A Analysis N B_ Coding © Design D_ Testin ° 0) 2 Four logic gates and five standard symbols for logic gates are shown. O) Draw one line to link each logic gate to its standard symbol. Not all standard s) Qinw. Logic gate Standard s} AND OR NAND LC NoT => i) 3 Identify the ‘ways that the design of a solution to a problem can be presented. i LLevetesans gi corszawisea | ‘CamScanner ee 4 Aprogram needs to make sure the value input for a mea: the value is a positive number + a value is always input the value is less than 1000. surement meets the following rules: ASST. ent (il) The input value needs to be stored in Write pseudocode to perform the dot a le Measurement check until a successful input is made. BB camscanee AEE TE Sree — Circle five fila-handling operations. caloulato count input output print sort search test total (5) Stato throo different features of a high-level programming language that a programmer could use mer. Give an example for each feature. to make sure that their program will be easier to understand by another program! 9 Beanscanne AAU 7 Analgorithm has been written in pseudocode to calculate & The algorithm then outputs the five-di The algorithm stops when —1 is input — igit number including the as the fourth digit. ‘os Flag © FALSE 02 REPEAT “= 03 20 UNTIL Flag (a). Give the line number(s) for the statements sony, Total + 0 yeor Counter € 1 TO 4 ' YVourPUT "Enter. sight counter ' qnpur (umber [Counter]... ~ Total < Total + Numbe: } Counter (7 Number (Counter] #0. THEN : Flag ¢ TRUE ENDIF ———* T Souttse, “TF NOT Flag) Gc THEN” 8 Number (5) \Mop(total, 10) > FOR Counter “<3 105 OUTPUT NumBer [Counter] NEXT . exit.“ Totaling Q ‘Count-controlled loop Post-condition loop .. check digit for a four-digit number. Geckdgit, = 3) GB camscanner ‘ne NT WRITE IN THIS MaAReans AEE EAE {) The algorithm does not check that each inputis a single doit Identify the place in he algorithm where this check should occur. Write pseudocode for this check. err Your pseudocode must make sure thatthe inputs a single digit and checks for -2 Place in algorithm... 8 Consider this logic expression. —~|S1olo |o/o Oo; 0° 4 CamScanner AQUA YAR 9 This flowchart represents an algorithm. CamScanner (1x >t (a) The array X(1:5) used in the flowchart contains this data: x(1] x2) x13] aa ~ : - ’ 1 Complete the trace table by using the data given in tho array, Fr Cc x1) x[2) t x[3] xX(4) X15) 10 1 5 7 so +. |CamScanner a 10 A music streaming service has a new database available for streaming. The table contains the fields: + SongWunber - the catalogue number, for example AG123. Title — the title of the song Author — the name of the song writer(s) ‘Singer - the name of the singer(s) Genre — the type of music, for example rock Minutes — the length of the song in minutes, for example 3.75 Recorded — the date the song was recorded. table named Songs to store details of songs (a) Identify the field that will be the most appropriate primary key for this table. Sang (b) Complete the table to identify the most appropriate data type for the fields in Fleld Data type O) =e & Title Text As 9 Recorded QATE Minutes Rear/ TMAL (2) SUM (Minutes) FROM Son: COUNT (Title) oy WHERE Genre = "rock"; E Genre = "rock"; (c) Explain the purpose of the oe language (SQL) statements. |CamScanner (ONION a i1_The variables P and Q are used to stor data in a program. P stores a string. stores a ch . aracter. 2), Write pseudocode statements to deciare the aah (a) Wale pamsoe variables P and 0, store "the World” in P and “go NOT TENTHS MARI Donor ARTE MH THI ARON oy ptt oi: wy + convert P10 upper case + de pesiten fn testing z (he rt haacterin we stig + ¥ More tho positon of Qin the variable Fos tion, (00 NOT WRITE THIS MARNE (00 NOT WaT TWD ARIG ___DONOT wrTE WN THis MARC ‘OO NOT WHITE IN TH MARGIN — : a orcas {Turn over_] BB canscanner + 0017052883512" MR 42 Atwo-dimensional (2D) array Account banking program. 12 mat sens pocis 1) contains account holders’ taining the following details: naunt of money in the account, for example 250.00 amene maximum total amount an account holder can ,00, for example 100.00 borrow from the bank after the account balance reaches 0.00, 0 «column three stores the withdrawal limit = the amount of money that can be withdrawn at one time, for example 200.00 ‘The amount of money in a bank account can be negative (overdrawn) but not by more ey ‘overdraft limit. For example, an account with an overdraft limit of 100.00 must have a balance tha than or equal to -100.00 Suitable error messages must be displayed if a withdrawal cannot take plat imple if the ‘overdraft limit or the size of withdrawal is exceeded. The bank account ID gives the index of each account holder's d el) ure two arrays. For example, account ID 20's details would be held in: Ah Account [20,1] and Account [20,2] AccDetails(20,1] AccDetails(20,2) and nccoe OY ‘The variable Size contains the number of accounts. ‘The arrays and variable Size have already “a the data stored. ents: Write a program that meets the following re’ ‘* checks the account ID exists and the ame and password entered by the account holder match the name and passwor .ccount [] before any action can take place + displays a menu showing tions available for the account holder to choose from: 1. display balance’ + allows an action te.be chosen and completed. Each action is completed by a procedure with a paratiggcof the account ID. ‘or program code and add comments to explain how your code works. is must contain suitable messages. tails) and the var & ‘not need to declare and initialise the data in the global arrays Account {] and CamScanner DO NOT WRITE IN THIS narecins

You might also like