Page 1 of 14 Version A Midterm Review 1. The sign means greater than. > = <= < 2. Before a programmer plans the logic of the program, he or she must. understand the problem write the program code test the program maintain the program 3. In a truth table, the expression is false. false OR false true OR true true OR false false OR true 4. If the DogWeight entered is 14, what will be the value printed for DogFee? 125 55 75
Page 2 of 14 105 5. In a structured program, any structure can be nested within another structure. 6. Variable names can be more than one word with blanks between the words. 7. data items may involve organizing or sorting them, checking them for accuracy, or performing calculations with them. Processing Outputting Converting Inputting 8. Both the while loop and the for loop are examples of pretest loops. 9. After programs are put into production, making necessary changes is called. conversion testing debugging maintenance 10. A(n) is any numeric variable you use to count the number of times an event has occurred. index key accumulator counter 11. The is used to represent output in a flowchart. square triangle circle
Page 3 of 14 parallelogram 12. In a selection structure, you perform an action or task, and then you perform the next action in order. 13. Computers process information (output) into data (input). 14. After a programmer plans the logic of a program, the next step is. coding the program testing the program understanding the problem translating the program 15. In a truth table, the expression is true. false AND true false AND false true AND false true AND true 16. A variable s unknown value is commonly called. default garbage initial deterministically random 17. If the DogWeight entered is 31, what will be the value printed for DogFee?
Page 4 of 14 55 105 75 125 18. The repetition of a series of steps is called a(n). infinite loop loop repeat flow flow 19. Most programming languages allow you to ask two or more questions in a single comparison by using a(n) operator that joins decisions in a single statement. IF OR AND XOR 20. If the DogWeight entered is 17, what will be the value printed for DogFee?
Page 5 of 14 105 75 55 125 21. If the DogWeight entered is 82, what will be the value printed for DogFee? 105 75 125 55 22. The assignment operator has left-to-right-to-left associativity, which means that the value of the expression to the left of the assignment operator is evaluated first and that the result is assigned to the operand on the right 23. The following pseudocode is an example of a structure.
Page 6 of 14 get firstnumber get secondnumber add firstnumber and secondnumber print result nested loop decision sequence 24. The process of naming program variables and assigning a type to them is called variables. proclaiming declaring initializing identifying 25. Any decision can be made using combinations of just two types of comparisons: equal and not equal. 26. Many loop control variable values are altered by, or adding to them. deprecating decrementing incrementing accumulating 27. The electronic components and circuitry of the system unit, such as the processor and memory, usually are part of or are connected to a circuit board called the fatherboard. 28. Fill in the blank in the following pseudocode: if somecondition is true then...do oneprocess...do theotherprocess then do while else
Page 7 of 14 29. A(n) decision is a decision in which two conditions must be true for an action to take place. XOR OR AND OR-ELSE 30. You represent a decision in a flowchart by drawing a decision symbol, which is shaped like a. parallelogram square diamond circle 31. You can use parentheses to override the default order of operations. 32. In most programming languages, before you can use any variable, you must include a for it. declaration proclamation header definition 33. When you combine AND and OR operators, the OR operators take precedence, meaning their Boolean values are evaluated first. 34. You can either increment or decrement the loop control variable. 35. An infinite loop is a flow of program logic that repeats and never ends.
Page 8 of 14 36. The following pseudocode is an example of a structure. if firstnumber is bigger than secondnumber then...print firstnumber else...print secondnumber sequence loop decision nested 37. errors are relatively easy to locate and correct because the compiler or interpreter you use highlights every error. Input Logic Syntax Process 38. A string variable can hold digits such as phone numbers and zip codes. 39. Besides AND and OR operators, most languages support a NOT operator. 40. The loop control variable is initialized after entering the loop. 41. The first step in a while loop is typically to. compare the loop control variable to a constant value execute the body of the loop increment the loop control variable initialize the loop control variable 42. In many programming languages, if you declare a variable and do not initialize it, the variable contains an unknown value until it is assigned a value.
Page 9 of 14 43. Declaring a starting value for a variable is known as the variable. defining declaring identifying initializing 44. The assignment operator is the sign. / * + = 45. Structured programs use spaghetti code logic. 46. A(n) is a named memory location whose value can vary. logic variable output input 47. With a(n), you perform an action or task, and then you perform the next action, in order. sequence problem ordered structure sequence structure loop sequence 48. A(n) decision is a decision in which at least one of two conditions must be true for an action to take place. nested AND NOT OR 49. Usually, variables are not considered to be equal unless they are identical. character
Page 10 of 14 integer floating point string 50. Placing a structure within another structure is called structures. stacking selecting shelling nesting 51. A variable can hold more than one value at any given moment in time. 52. You may hear programmers refer to looping as. case execution selection iteration 53. Typically, a programmer develops a program s logic, writes the code, and the program, receiving a list of syntax errors. tests compiles runs executes 54. A structured program must contain a sequence, selection, and loop structure. 55. In a flowchart, the is used to represent processing. circle triangle diamond rectangle 56. The process of finding and correcting program errors is called.
Page 11 of 14 syntax-checking desk-checking error correcting debugging 57. The following pseudocode is an example of a structure. get number while number is positive...add to sum...get number nested loop decision sequence 58. If the DogWeight entered is 80, what will be the value printed for DogFee? 55 105 125 75 59. Programs that use code logic are unstructured programs that do not follow the rules of structured logic. spaghetti case nested loop 60. A structured program includes only combinations of the three basic structures:.
Page 12 of 14 sequence, iteration, and loop iteration, selection, and loop identification, selection, and loop sequence, selection, and loop
Page 13 of 14 Version A Answer Sheet Midterm Review 1. > 2. understand the problem 3. false OR false 4. 55 5. 6. 7. Processing 8. 9. maintenance 10. counter 11. parallelogram 12. 13. 14. coding the program 15. true AND true 16. garbage 17. 105 18. loop 19. AND 20. 75 21. 125 22. 23. sequence 24. declaring 25. 26. incrementing 27. 28. else 29. AND 30. diamond 31.
Page 14 of 14 32. declaration 33. 34. 35. 36. decision 37. Syntax 38. 39. 40. 41. initialize the loop control variable 42. 43. initializing 44. = 45. 46. variable 47. sequence structure 48. OR 49. string 50. nesting 51. 52. iteration 53. compiles 54. 55. rectangle 56. debugging 57. loop 58. 105 59. spaghetti 60. sequence, selection, and loop