Chapter 12 Problem Solving Procedures Chapter 12 Question Bank Problem Solving Procedures Multiple Choice Questions (U01C12L01Q001) Which of the following can be used for problem analysis? (1) IPO diagram (2) flow chart (3) pseudocode A. (1) only B. (2) only C. (2) and (3) only D. (1), (2) and (3) Answer A (U01C12L01Q002) Problem solving procedures include: (1) developing a solution (2) algorithm design (3) problem identification A. (1) and (2) only B. (1) and (3) only C. (2) and (3) only D. (1), (2) and (3) Answer D (U01C12L01Q003) We need to add comments when writing a program because (1) computer cannot translate programs that do not have comments. (2) adding comments may help the program easier to read. (3) comments may help reduce the file size of object program. A. (1) only B. (2) only C. (1) and (2) only D. (1) and (3) only Answer B Computer & Information Technology for HKCEE (Core Module) 1 © Pearson Education Asia Limited 2004 Chapter 12 Problem Solving Procedures Question Bank (U01C12L01Q004) Arrange the following problem solving procedures in the correct order. (1) algorithm design (2) debugging and testing (3) problem analysis (4) problem identification (5) developing a solution A. (4), (3), (1), (2), (5) B. (4), (3), (1), (5), (2) C. (3), (4), (1), (5), (2) D. (3), (4), (1), (2), (5) Answer B (U01C12L01Q005) Which of the following problem solving procedures involves the work of “breaking down the problem into sub-problems”? A. algorithm design B. debugging and testing C. problem analysis D. problem identification Answer C (U01C12L01Q006) Which of the following problem solving procedures involves the work of “designing the step-by-step procedures of solving a problem”? A. algorithm design B. debugging and testing C. problem analysis D. problem identification Answer A Computer & Information Technology for HKCEE (Core Module) 2 © Pearson Education Asia Limited 2004 Chapter 12 Problem Solving Procedures Question Bank (U01C12L01Q007) What should be done in the solution development stage of solving a problem? A. Identify what the problem actually is. B. Design the step-by-step procedures of solving a problem. C. Realise the algorithm designed by practical means to form a solution. D. Prepare documents that describe the solution. Answer C (U01C12L01Q008) Which of the following statements about stepwise refinement is correct? A. B. It is a common problem analysis method of breaking down a complicated problem in a series of steps. It is used to show the modular structure of a problem and the relationship between modules. C. It is used to find out and remove all possible errors in the solution. D. It is a set of step-by-step procedures which solves a specific problem in a finite number of steps. Answer A (U01C12L01Q009) Which of the following can be used to express an algorithm? (1) flowchart (2) pseudocode (3) HTML source code A. (1) only B. (3) only C. (1) and (2) only D. (1), (2) and (3) Answer C Computer & Information Technology for HKCEE (Core Module) 3 © Pearson Education Asia Limited 2004 Chapter 12 Problem Solving Procedures Question Bank (U01C12L01Q010) What is the following flowchart symbol? A. decision box B. terminal box C. predefined process box D. process box Answer D (U01C12L01Q011) What is the following flowchart symbol? A. B. C. D. decision box terminal box predefined process box process box Answer B (U01C12L01Q012) What is the following flowchart symbol? A. decision box B. input/output box C. predefined process box D. process box Answer C Computer & Information Technology for HKCEE (Core Module) 4 © Pearson Education Asia Limited 2004 Chapter 12 Problem Solving Procedures Question Bank (U01C12L01Q013) Which of the following is the key factor that will affect the efficiency of a particular method for solving a problem? A. number of steps in the algorithm designed B. number of steps that will be carried out during the execution of the solution C. the exact wordings of the algorithm designed D. the length of each step in the algorithm designed Answer B (U01C12L01Q014) Which of the following flowchart symbols indicates that a decision is to be made in an algorithm? A. B. C. D. Answer C Computer & Information Technology for HKCEE (Core Module) 5 © Pearson Education Asia Limited 2004 Chapter 12 Problem Solving Procedures Question Bank (U01C12L01Q015) Which of the following flowchart symbols indicates that an input/output process is required in an algorithm? A. B. C. D. Answer B Computer & Information Technology for HKCEE (Core Module) 6 © Pearson Education Asia Limited 2004 Chapter 12 Problem Solving Procedures Question Bank Conventional Questions (U01C12L02Q001) Linda prepares to design a program to determine whether the test mark of a subject is pass or not. Her algorithm is shown below: BEGIN Input Mark1 Input Mark2 Average = (Mark1 + Mark2) / 2 If Average 50 Then Result = Pass Else Result = Fail Print Result END (a) (i) Which kind of control structure has the above algorithm used? (1 mark) (ii) Besides the above structure, state TWO other kinds of control structure. (2 marks) (iii) Sketch a flowchart to demonstrate the above algorithm. (4 marks) (iv) What is the next step to be done after completing the algorithm design? (1 mark) Before designing the algorithm in (a), Linda has drawn an IPO diagram. (b) (i) What is the use of an IPO diagram? (1 mark) (ii) Sketch the corresponding IPO diagram before designing the algorithm in (a). (3 marks) Computer & Information Technology for HKCEE (Core Module) 7 © Pearson Education Asia Limited 2004 Chapter 12 Problem Solving Procedures Question Bank Answers (a) (i) selection control structure (1) (ii) sequence (1), iteration (1) (iii) BEGIN Input Mark1, Mark2 Average = (Mark1 + Mark2) / 2 True Average 50? Result = Pass False Result = Fail Print Result END (4) (iv) coding (1) (b) (i) Identify the inputs, outputs and processing of the problem. (1) (ii) Input Input 1, Input 2 (1) Process Output Assign (Mark1+Mark2) / 2 to Average (0.5); Print Result (1) If Average 50, then assign “Pass” to Result; else assign “Fail” to Result (0.5) Computer & Information Technology for HKCEE (Core Module) 8 © Pearson Education Asia Limited 2004 Chapter 12 Problem Solving Procedures Question Bank (U01C12L02Q002) In order to increase productivity of staff and improve customer services, an electronic products company plans to renew its existing computer system. The company will appoint some system analysts for the system upgrade. (a) System analysts have to identify the problem before renewing the computer system. State ONE reason of taking this step. (1 mark) (b) State a tool that may be used by a programmer for problem analysis. (1 mark) (c) (i) State TWO tools that may be used for algorithm design. (2 marks) (ii) What should a programmer be aware when designing algorithm? State TWO of these items. (2 marks) Programmers have to conduct debugging and testing when designing a program. (d) State ONE difference between debugging and testing. (2 marks) (e) State TWO types of errors that may be presence in designing programs. Give an example to each type. (2 marks) Programmers have to write program documents after designing a program. (f) State ONE reason for documentation. (g) State ONE type of program documents. Answers (a) Guarantee the finished system satisfies the users’ need. (1) (b) IPO diagram (c) (i) pseudocode (1), flowchart (1) (1 mark) (1 mark) (ii) Algorithm should be clear enough so as to reduce logic errors. / Each step in the algorithm must be defined correctly. / Make sure the algorithm will stop in a finite number of steps. (Any 2 1) (d) Debugging: locating and fixing the defects in a program (1); Testing: the process of showing the presence of errors. (1) (e) syntax error: misspell of program statements / omission of punctuation marks run-time error: divide by zero error logic error: the age has negative value (type of error: 0.5 + 0.5, example of error: 0.5 + 0.5) (f) The program can be reused. / Users may know the program data from the documents. / Other programmers may need to maintain the program or make amendments on it. (Any 1 1) (g) program manual / reference manual (Any 1 1) Computer & Information Technology for HKCEE (Core Module) 9 © Pearson Education Asia Limited 2004 Chapter 12 Problem Solving Procedures Question Bank (U01C12L02Q003) Read the problem identification below. There are two brands of soft drinks. Brand A is larger in volume expensive than Brand B. A person wants to determine which brand of is more economical. (a) Identify the inputs and outputs of the following problem. (b) Design an algorithm in pseudocode to solve the problem. Answers (a) Input Type Volume of Brand A soft drinks Number Price of Brand A soft drinks Number Volume of Brand B soft drinks Number Price of Brand B soft drinks Number but more soft drink (5 marks) (7 marks) (4) Output Type “Brand A is more economical.” or “Brand B is more economical.” Text (1) (b) Input volume of Brand A Input price of Brand A Input volume of Brand B Input price of Brand B unit price of Brand A = price of Brand A volume of Brand A unit price of Brand B = price of Brand B volume of Brand B If unit price of Brand A > unit price of Brand B Then output = “Brand B is more economical” Else output = “Brand A is more economical” Print output (inputs: 0.5 4; compute unit prices of Brand A and Brand B: 2; selection control structure: 2; output: 1) Computer & Information Technology for HKCEE (Core Module) 10 © Pearson Education Asia Limited 2004 Chapter 12 Problem Solving Procedures Question Bank (U01C12L02Q004) (a) A program is written to find the roots of an equation Ax2 + Bx + C = 0. Identify the necessary inputs to and expected outputs from the program. State the types of inputs and outputs. (6 marks) The block diagram below shows the structure of a program which is used to calculate the daily wages of different workers. Daily Wages A Input Working Hour B Calculate Basic Wages Calculate Daily Wages F Find out Overtime Wages E C D (b) Complete the block diagram by matching the following with the modules A – F. (6 marks) (i) Calculate Overall Wages (ii) Calculate Overtime Wages (iii) Input Working Hour and Hourly Wages (iv) Output Daily Wages (v) Calculate Overtime Hours (vi) Input Hourly Wages Answers (a) Inputs 2 Type Coefficient of x (i.e. A) (0.5) Number (0.5) Coefficient of x (i.e. B) (0.5) Number (0.5) Constant term (i.e. C) (0.5) Number (0.5) Outputs Type One root of the equation (0.5) OR Two roots of the equation (0.5) OR “No real root”(0.5) Number (0.5) Number (0.5) Computer & Information Technology for HKCEE (Core Module) Text (0.5) 11 © Pearson Education Asia Limited 2004 Chapter 12 (b) (i) (ii) (iii) (iv) (v) (vi) Problem Solving Procedures Question Bank E (1) D (1) A (1) F (1) C (1) B (1) (U01C12L02Q005) (a) State the differences between an algorithm and a program. (2 marks) Read the problem identification below. Find out the more economical one between the two brands of orange juice. (Brand A and Brand B) with different volumes and prices. (b) Identify the inputs and outputs of the problem. (3 marks) The block diagram below shows the structure of a program which is used to find which brand is more economical. More economical brand Input data C D A E B F G (c) Complete the diagram by matching the letters with the modules below. (2 marks) (i) Calculate unit price in $/mL of each brand (ii) Display the brand with a lower unit price (iii) Find out the more economical brand (iv) Find out the brand with a lower unit price (v) Get volume and price of Brand A (vi) Get volume and price of Brand B (vii) Output data (d) Write down the algorithm of “Find out the brand with a lower unit price” using selection control structure. (2 marks) (e) Design an algorithm in pseudocode to solve the problem. (3 marks) Computer & Information Technology for HKCEE (Core Module) 12 © Pearson Education Asia Limited 2004 Chapter 12 Problem Solving Procedures Question Bank Answers (a) An algorithm is the design of a solution, it shows the step-by-step procedures to solve a problem. (1) A program is the instruction sets which are converted from an algorithm. The instruction sets tell the computer to complete tasks step-by-step. (1) (b) Input: Volume and price of Brand A (1) Volume and price of Brand B (1) Output: The more economical brand (1) (c) (i) E (ii) G (iii) A (iv) F (v) C (vi) D (vii) B (all correct: 2) (d) If unit price of Brand A < unit price of Brand B (1) then Brand A has a lower unit price (0.5) else Brand B has a lower unit price (0.5) (e) Input volume and price of Brand A Input volume and price of Brand B Compute unit price in $/mL of Brand A Compute unit price in $/mL of Brand B If unit price of Brand A < unit price of Brand B then Brand A has a lower unit price else Brand B has a lower unit price Print the brand with a lower unit price (input volume and price: 1; compute unit price: 1; selection control structure: 0.5; Output: 0.5) Computer & Information Technology for HKCEE (Core Module) 13 © Pearson Education Asia Limited 2004
© Copyright 2026 Paperzz