Parameter x is used to pass data to procedure MyProc in the following pseudocode: x 4 CALL
Question:
(b) The pseudocode includes the use of parameters. State two other features in the pseudocode that support a modular approach to programming.
Question 2:
A company keeps details of its product items in a 1D array, Stock. The array consists of 1000 elements of type StockItem. The record fields of StockItem are: Field Typical value ProductCode "BGR24-C" Price 102.76 NumberInStock 15 (a) Write pseudocode to declare the record structure StockItem.
(b) Write pseudocode to declare the Stock array.
(c) Write pseudocode to modify the values to element 20 as follows: set the price to 105.99 increase the number in stock by 12
d) A stock report program is developed. Write pseudocode to output the information for each stock item that has a price of at least 100. Output the information as follows: Product Code: BGR24-C Number in Stock: 15
Question 3:
Members of a family use the same laptop computer. Each family member has their own password. To be valid, a password must comply with the following rules: 1 At least two lower-case alphabetic characters 2 At least two upper-case alphabetic characters 3 At least three numeric characters 4 Alphanumeric characters only A function, ValidatePassword, is needed to check that a given password follows these rules. This function takes a string, Pass, as a parameter and returns a boolean value: TRUE if it is a valid password FALSE otherwise (a) Write pseudocode to implement the function ValidatePassword. Refer to the Insert for the list of pseudocode functions and operators.
(b) The ValidatePassword function will be tested. (i) Give a valid password that can be used to check that the function returns TRUE under the correct conditions. Password1:
(ii) Password1 is modified to test each rule separately. Give four modified passwords and justify your choice. Password to test rule 1:
(iii) When testing the ValidatePassword function it is necessary to test all possible paths through the code. State the name given to this type of validation testing.
(iv) A program consisting of several functions can be tested using a process known as 'stub testing'. Explain this process.
Question 4:
LogArray is a 1D array containing 500 elements of type STRING. A procedure, LogEvents, is required to add data from the array to the end of the existing text file LoginFile.txt Unused array elements are assigned the value "Empty". These can occur anywhere in the array and should not be added to the file. Write pseudocode for the procedure LogEvents. Refer to the Insert for the list of pseudocode functions and operators.
Question 5:
Yvette runs a company that books walking holidays for groups of people. She has a website that customers use to book the holidays.
(a) The website has a URL and an IPv6 address. Describe, using an example, the format of an IPv6 address.
(b) An IP address can be static or dynamic. Describe static and dynamic IP addresses. Static
(c) Yvette's company has a LAN (Local Area Network) that has hybrid topology. (i) Describe the characteristics of a LAN.
(ii) The LAN has a range of different topologies. One subnetwork connects four computers and one server set up as a star topology. Describe how packets are transmitted between two of the computers in this subnetwork.
(d) The LAN has both wired and wireless connections. (i) Ethernet cables connect the computers to the server. Identify three other hardware components that might be used to set up the LAN.
(ii) Describe how Carrier Sense Multiple Access/Collision Detection (CSMA/CD) manages collisions during data transmission.
Question 6:
A cake factory uses machines to make cakes. (a) Complete the following descriptions of types of system. Write the correct missing term in the spaces. The factory uses a .................................................. system to record data such as the number of cakes being produced each hour. When the data collected from sensors are analysed and used as .................................................. it is a .................................................. system. One example of this system, used in the factory, is to maintain a constant temperature in the ovens. It uses a .................................................. to measure the values.
Question 7:
(a) A programmer uses the process of stepwise refinement to break down a problem. Explain the purpose of stepwise refinement. (b) Programming languages support different data types. These usually include STRING and REAL. Complete the table by giving four other data types and an example data value for each. Data type Example data value [4] (c) An experienced programmer is working on a program that is written in a language she is not familiar with. (i) State one feature of the program that she should be able to recognise. ........................................................................................................................................... ..................................................................................................................................... [1] (ii) State the type of skill that would allow her to recognise this feature. ........................................................................................................................................... ..................................................................................................................................... [1] (d) Give three methods that may be used to identify and locate errors in a program after it has been written. You may include one feature found in a typical Integrated Development Environment (IDE). 2 (a) An algorithm is needed to input a list of numbers representing test marks for a class of 30 students. The algorithm will output the number of students who have a mark greater than 75. It will also output the average mark for the class. Document the algorithm using structured English.
Applied Regression Analysis and Other Multivariable Methods
ISBN: 978-1285051086
5th edition
Authors: David G. Kleinbaum, Lawrence L. Kupper, Azhar Nizam, Eli S. Rosenberg