Chapter 02: Beginning the Problem-Solving Process

?True / False1.?The final step in the problem-solving process is to desk-check the program.?a.?True?b.?FalseANSWER:??False2.?You need to consider all information when analyzing a problem, even if it is unnecessary to the solution.?a.?True?b.?FalseANSWER:??False3.?Pseudocode uses standardized symbols to visually depict an algorithm.?a.?True?b.?FalseANSWER:??False4.?You need to use both pseudocode and a flowchart when planning an algorithm.?a.?True?b.?FalseANSWER:??False5.?Pseudocode is not standardized, each programmer has his/her own version.?a.?True?b.?FalseANSWER:??True6.?When using flowcharts, the input/output symbol is represented by an oval.?a.?True?b.?FalseANSWER:??False7.?When using flowcharts, the processing symbol is represented by a rectangle.?a.?True?b.?FalseANSWER:??True8.?A processing item in an IPO chart represents an intermediate value that the algorithm uses when processing the input into the output.?a.?True?b.?FalseANSWER:??True9.?The main reason for desk-checking an algorithm is to check for spelling errors.?a.?True?b.?FalseANSWER:??True10.?To ensure the algorithm is working correctly, a programmer should desk-check it using both valid and invalid data.?a.?True?b.?FalseANSWER:??FalseMultiple Choice11.?What is the first step in the problem-solving process??a.?analyze the problemb.?plan the algorithm?c.?code the algorithm into a programd.?write the documentationANSWER:??a12.?What is the second step in the problem-solving process??a.?analyze the problemb.?code the algorithm into a program?c.?write the documentationd.?plan the algorithmANSWER:??d13.?Which of the following best represents the goal of the problem-solving process??a.?inputb.?output?c.?processingd.?programANSWER:??b14.?What type of chart helps programmers organize and summarize the results of the analysis step??a.?flowb.?pseudocode?c.?IPOd.?ROIANSWER:??c15.?Which of the following uses standardized symbols to visually depict an algorithm??a.?Venn diagramb.?IPO chart?c.?pseudocoded.?flowchartANSWER:??d16.?What programming technique allows programmers to jot down their ideas using a human-readable language without having to worry about the syntax of the programming language itself??a.?Venn diagramb.?IPO chart?c.?pseudooded.?flowchartANSWER:??c17.?What does the oval symbol in a flowchart represent??a.?start/stopb.?input/output?c.?processingd.?branchingANSWER:??a18.?What does the parallelogram symbol in a flowchart represent??a.?start/stopb.?input/output?c.?processingd.?branchingANSWER:??b19.?What does the rectangle symbol in a flowchart represent??a.?start/stopb.?input/output?c.?processingd.?branchingANSWER:??c20.?What is used to connect the different symbols in a flowchart??a.?dotsb.?hash marks?c.?flowlinesd.?algorithmsANSWER:??c21.?What type of value does a processing item represents when processing the input into the output??a.?beginningb.?intermediate?c.?finald.?sentinelANSWER:??b22.?Review the following pseudocode. What type of item is sales tax rate?1. enter the sale price and sales tax rate2. calculate the cost by multiplying the sale price by the?sales tax rate and then adding the result to the sale price3. display the cost??a.?processingb.?output?c.?coded.?inputANSWER:??d23.?What is another name for desk-checking??a.?chartingb.?drawing?c.?hand-tracingd.?checking syntaxANSWER:??c24.?To be sure an algorithm works correctly, you should desk-check it several times using which of the following??a.?valid data onlyb.?invalid data only?c.?both valid and invalid datad.?invalid data only if valid data works correctlyANSWER:??c25.?Which of the following pseudocode statements represents output??a.?display the miles per gallonb.?calculate the mile per gallon?c.?enter the miles drivend.?divide the miles driven by gallons usedANSWER:??a26.?In the following pseudocode, which item is considered a processing item??1. enter the midterm score and final score2. calculate the sum by adding together the?midterm score and final score3. calculate the average score by dividing the sum by 24. display the average score??a.?midterm scoreb.?sum?c.?final scored.?averageANSWER:??b27.?Which of the following would be an example of invalid data??a.?an age between 1 and 100b.?a negative tax rate?c.?a random number between 0 and 1d.?a selling price of $1000ANSWER:??b28.?Which step comes after you plan the algorithm in the problem-solving process??a.?analyze the problemb.?desk-check the algorithm?c.?code the algorithm into a programd.?evaluate and modify the programANSWER:??b29.?Which of the following best describes a computer program that is implemented with a computer??a.?diagramb.?problem?c.?flowchartd.?solutionANSWER:??d30.?In a pseudocode algorithm, what part of language should each instruction begin with??a.?adverbb.?noun?c.?articled.?verbANSWER:??d31.?In the following pseudocode algorithm, what is the output given the following inputs?sale price=2.00sales tax rate=6%?1. enter the sale price and sales tax rate2. calculate the cost by multiplying the sale price by the?sales tax rate and then adding the result to the sale price3. display the cost??a.?2.00b.?2.06?c.?2.12d.?.12ANSWER:??c32.?What do some programmers use to organize and summarize the results of a problem analysis??a.?Low-Flo diagramb.?IPO chart?c.?POI diagramd.?Sequence-Seletion-Iteration chartANSWER:??b33.?In the following pseudocode algorithm, which of the following is considered a processing item??1. enter the sale price and sales tax rate2. calculate the sales tax by multiplying the sale price by the?sales tax rate3. calculate the cost by adding the sales tax to the sale price4. display the cost??a.?sales taxb.?sale price?c.?tax rated.?costANSWER:??a34.?Most algorithms begin with instructions to do which of the following??a.?perform calculationsb.?print results?c.?enter input itemsd.?output user instructionsANSWER:??c35.?The algorithm is recorded in which section of the IPO chart??a.?inputb.?processing?c.?outputd.?all sectionsANSWER:??b36.?In which column of the desk-check table do you enter the expected output of the following algorithm??1. enter the sale price and sales tax rate2. calculate the sales tax by multiplying the sale price by the?sales tax rate3. calculate the cost by adding the sales tax to the sale price4. display the cost?Desk-check Table:sale price ? ?sales tax rate ? ?sales tax ? ?cost??a.?costb.?sales tax?c.?tales tax rated.?sale priceANSWER:??aSubjective Short Answer37.?Explain the importance of the Analyze the Problem step of the problem-solving process. What are the two most important components?ANSWER:??You cannot solve a problem unless you understand it, and you cannot understand a problem?unless you analyze it—in other words, unless you identify its important components. The two?most important components of any problem are the problem’s output and its input. The output?is the goal of solving the problem, and the input is the item or items needed to achieve the goal.?When analyzing a problem, you always search first for the output and then for the input.38.?Why is the use of an IPO chart so important to the problem-solving process?ANSWER:??An IPO chart is used by the programmer to organize and summarize the results of the analysis step.??By being able to view the necessary input, processing, and output items, the programmer can get a clear view of all of the necessary components required in the program.39.?In this chapter you were introduced to flowcharts and pseudocode as two methods of planning algorithms.??From what you have seen of each, which do you initially prefer to use???Why?ANSWER:??Answers may vary.??Students should support their choice of either flowchart or pseudocode, but may also elect to use both.40.?In which problem-solving step would you expect to spend the most time???Why?ANSWER:??Of all of the problem-solving steps, the most time would be spent in planning the algorithm.??This is where you are actually designing the solution to the problem.??While many may believe coding the algorithm into a program may take the longest, once the solution is designed, coding can be a simple process.41.?What role would the user of a program being written play in the development of the program?ANSWER:??In order for the programmer to solve the problem, he/she must first understand the problem.??If the programmer has any questions about the problem, the programmer should consult the user.??The user understands more about the present process than anyone.42.?Why would making a modification, such as changing the order of steps, to a flowchart be easier than making the same modification to pseudocode???Explain your answer.ANSWER:??Since symbols in a flowchart are connected by flowlines, if a programmer wishes to change the order of the steps, he/she can simply redraw the flowlines.??A similar change in pseudocode may require much erasing.43.?Give an example where a programmer may want to use a combination of pseudocode and flowchart in designing a solution to a problem.ANSWER:??Answers may vary.??In a large program, some programmers may wish to sketch the general outline of the program in pseudocode, but wish to use a flowchart to design the detail of each part of the program.44.?Why is it important to desk-check the algorithm???Explain your answer.ANSWER:??Before coding the program, the programmer wishes to ensure he/she did not leave out any steps in the algorithm and/or the steps are in the correct order.45.?What is the difference between valid data and invalid data???Give an example of each.ANSWER:??Answers may vary.??Valid data is the data the algorithm is expecting.??Invalid data is data the algorithm is not expecting.One example could involve the program obtaining a person’s age.??Valid data would be integers in the range from 1-100, where invalid data could be a value of -37 or 973.??It would be resonable for a person’s age to be from 1-100, but not a negative number or a very high integer value. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download