Sie sind auf Seite 1von 12

Chapter 1 Problem Solving

In most cases, a well-written program need not be tested. (T/F) F The analysis and design steps of program planning are largely independent of the particular computer language the programmer is using. (T/F) T What does the parallelogram flowchart symbol represent? (A) Input/Output (B) Terminal (C) Decision (D) Connector (E) Process A A flowchart is an arrangement of geometric shapes connected by arrows. (T/F) T An algorithm is defined as: (A) a mathematical formula that solves a problem. (B) a tempo for classical music played in a coda. (C) a logical sequence of steps that solve a problem. (D) a tool that designs computer programs and draws the user interface. C Pseudocode is (A) data that have been encoded for security. (B) the incorrect results of a computer program. (C) a program that doesn't work. (D) the obscure language computer personnel use when speaking.

(E) a description of an algorithm similar to a computer language. E A top-down chart is the same thing as a flowchart. (T/F) F When starting a new program, it is best to start writing code as soon as possible to avoid wasting time thinking about it. (T/F) F Pseudocode and flowcharts are two different tools or methods used in planning a solution to a problem. (T/F) T Often a problem is too difficult to understand until one writes the program. (T/F) F Which one of the following is NOT one of the four basic types of statement structures? (A) Sequence (B) Loop (C) Decision (D) Input/output D Which of the following is the proper order of procedures used in the problem-solving process? (A) Design, analysis, coding, testing (B) Analysis, testing, design, coding (C) Analysis, design, coding, testing (D) Analysis, design, testing, coding (E) Design, testing, analysis, coding C Although the documentation step is usually listed last in the problem-solving process, it should actually begin when the problem is first defined and continue through the problem-solving process. (T/F)

T Suppose your supervisor at work wants you to write a program to accomplish a task that he has specified. However, he has not let you know which computer language to use. It is still possible to design the program in pseudocode. (T/F) T A programmer must play detective and track down all errors since their are currently no tools available to help with this process. (T/F) F Which of the following types of charts shows only the relationships between general program tasks without showing specific modules or directions for data flow? (A) Top-down chart (B) Flowchart (C) Both A and B (D) Neither A nor B A Although a flowchart (as its name suggests) depicts data flow very well, it is not easily modified once written. (T/F) T Suppose in the very early stages of the problem-solving process, your supervisor wants you to show her the relationships between the various processes that will be needed to solve the problem. The best way to do this would be to use (A) a top-down chart. (B) a flowchart. (C) a sample program. (D) pseudocode. B If a problem is very complex, extensive design prior to coding will actually delay the completion of the project. (T/F) F

The divide-and-conquer-method of problem solving breaks a problem into large, general pieces first, then refines each piece until the problem is manageable. (T/F) T If you are writing a program that needs to repeat a series of calculations, what programming structure should you use to repeat the calculations? (A) Sequence structure (B) Decision structure (C) Looping structure (D) Unconditional branching C The purpose of a test or decision in a looping structure is to tell when the loop should end. (T/F) T "Desk-checking" refers to (A) the continual problem programmers have with losing things. (B) timing a program to see how fast it completes its tasks. (C) testing an algorithm at the flowchart stage using several different kinds of data. (D) having a fellow programmer read your pseudocode to be sure it is understandable. C Flowcharts, pseudocode, and top-down charts can be used to solve problems only in Visual Basic. (T/F) F Order the steps in the program development cycle starting with 1 for the first step and so on. ____ ____ ____ ____ ____ ____ Program design (devise an algorithm). Test the program until it is error free. Test the design. Problem analysis (define the problem). Determine the input and output. Review the code.

____ ____ ____

Add new features. Code the program. Enter the program.

Ans: 3 8 4 1 2 7 9 5 6 What are the four basic methods of control used in designing structured algorithms? Ans: sequence, decision, loop, unstructured branch Define algorithm Ans: A logical sequence of precise steps that solve a problem. What does the rectangle flowchart symbol represent? (A) Input/Output (B) Terminal (C) Decision (D) Connector (E) Process E What does the diamond flowchart symbol represent? (A) Input/Output (B) Terminal (C) Decision (D) Connector (E) Process C What does the circle flowchart symbol represent? (A) Input/Output (B) Terminal

(C) Decision (D) Connector (E) Process D What does the "rectangle with rounded sides" flowchart symbol represent? (A) Input/Output (B) Predefined process (C) Decision (D) Start/Stop (E) Process D The process of finding and correcting errors in a program is called (A) pseudocoding. (B) debugging. (C) algorithms. (D) development cycles. B A graphical depiction of the logical steps to carry out a task and show how the steps relate to each other is called a(n) (A) flowchart. (B) pseudocode. (C) algorithms. (D) hierarchy chart. A 35. Define pseudocode Ans: English-like phrases used as a problem-solving tool to outline the task.

36. Define flowchart Ans: A problem-solving tool that graphically depicts the logical steps to carry out a task and show how the steps relate to each other. 37. Explain the divide-and-conquer method. Ans: Using hierarchy charts in the initial planning of a program. Breaking down the major parts of a program so we can see what must be done in general. Then refining each module into more detailed plans using flowcharts or pseudocode. 38. What is a module? ans: A part of a program. 39. What is a sequence structure? Ans: One line executed right after another without skipping over any lines. 40. Define desk checking. Ans: Testing an algorithm at the flowchart stage before being coded into a program. Different data should be used as input, and the output checked. 41. What is a decision structure? Ans: When a decision is used to determine whether a series of instructions should be executed. 42. Flowcharts, pseudocode, and hierarchy charts are _____________________. Ans. problem-solving tools 43. Every diamond symbol on a flow chart should have _________ flow lines coming out of it. Ans. two 44. True/False It is not necessary to label flow lines on a flow chart that exit from a decision symbol. 45. True/False Flow lines on a flow chart do not have directional arrows. 46. True/False There are many styles of pseudocode. 47. A Goto statement is an example of the _________________ structure. Ans. Unconditional branch 48. The design tool that looks similar to an organizational chart is called a ________________. Ans. hierarchy chart 49. A hierarchy chart shows each ____________ of a program.

a. event b. module c. unconditional branch d. keystroke B 50. The main benefit of a hierarchy chart is in the initial planning of a program in which the main problem is broken down into smaller programs. This is called the ___________________ approach. a. subset b. branching c. divide-and-conquer d. programming C 51. Symbols on a flowchart are connected using _____________. a. flowlines b. on-page connectors c. branching statements d. terminal symbols A 52. Many programmers plan their programs using a sequence of steps, referred to as the __________________. Ans. program development cycle. 53. Explain the importance of documentation in a program. Ans. Documentation is intended to allow another person, or the programmer at a later date, to understand the program. 54. When tracing a flowchart, begin at the _____________ symbol and proceed from symbol to symbol until reaching the _______ symbol. a. start/end b. decision/process

c. start/decision d. process/connector A 55. True/False Desk checking means running the program after you code it. 56. Which of the following is NOT a universal problem-solving tool? a. flowchart b. hierarchy chart c. Task-Duty chart d. pseudocode C 57. Which of the following is NOT a logical programming construct? a. sequence b. selection c. iteration d. pseudocode D 58. ______________________ appears in some languages as Goto statements and involves jumping from one place in a program to another. Ans: unconditional branch 59. Structured programming forbids which of the following logical programming constructs? a. sequence b. selection c. unconditional branch d. iteration C 60. ______________ are a problem-solving tool that is time-consuming to write and difficult to update.

Ans: flowcharts 61. True/False Flowcharts clearly illustrate the logical flow of programming techniques and are a valuable tool in the education of programmers. 62. Many professional programmers prefer to use pseudocode and hierarchy charts as problem solving tools because ______________ are difficult to update and time-consuming to write. Ans: flowcharts 63. True/False There are many styles of pseudocode. 64. Many people draw ____________ around each item in a hierarchy chart. Ans: rectangles 65. The first step in writing instructions to carry out a task is to determine the ____________. a. output b. input c. process d. client A 66. The last step in writing instructions to carry out a task is to determine the ___________. a. output b. input c. process d. client C 67. True/False Just as one should not try to build a building without a blueprint, a programmer should not try to write a program without a plan. 68. True/False Visual Basic has a "smart editor" that will point out all errors in the program before it is executed. 69. True/False Flowcharts "flow" from left to right across a page. 70. True/False No standards exist for the amount of detail required within each flowchart symbol. 71. The symbol used to represent the beginning of a flow chart is called:

a. rectangle b. terminal c. diamond d. decision B 72. Arithmetic and data-manipulation operations are represented in the __________ flowchart symbol. a. terminal b. input/output c. processing d. decision C 73. Logic or comparison operations are contained in which of the following flowchart symbols? a. oval b. parallelogram c. rectangle d. diamond D 74. True/False The flow lines in a good flowchart should not have arrows on them. It should be inherently obvious which way to go. 75. Hierarchy plus Input-Process-Output charts are called: a. HIPO b. Hierarchy Plus c. Flowcharts d. VTOC A

Das könnte Ihnen auch gefallen