midterm_1 x
The piece of hardware that performs processing tasks is the central data unit. A) True 2. With a 12-item array, the subscripts you can use are 0 through 11. 3. When using the OR operator, an action is taken when at least one of the comparisons evaluates to true. 4. All of the variables in an array have the same name and data type but are differentiated with special numbers called subscripts. 5. An error commonly made by beginning programmers is to forget that array subscripts start with the integer 1. 6. When you use a loop within a computer program, you can write one set of instructions that operates on multiple, separate sets of data. 7. A noun would be a good choice for a variable or constant identifier. 8. What operator has the lowest precedence? 9. What will be the value stored in the variable total when the following code completes executing: 10. To use computer programs, you must first load them into memory. 11. Usually, all the values in an array have something in common. 12. Create a program using a loop that calculates the square of each number (the number raised to the second power) starting with 1 and outputs the square . The program should end when the square is equal to 100. You should use a WHILE loop. HTML Editor 13. A structure that includes separate actions when an expression is true and when it is false is called a(n) ____ structure. 14. The ____ variable is initialized before entering the loop. 15. Which of the following is correct if the data type for weight is num? 16. What is the answer for the following operation: 12/3 – 2 * 10 + (7-1) 17. At the beginning of any method, it is the programmer’s responsibility to ____ all variables that must start with a specific value. 18. is the set of physical devices associated with a computer. 19. A loop control variable’s value is tested to control the loop’s execution. 20. A variable declaration is a statement that provides a data type and identifier for a variable 21. ____ a data item means you override incorrect data by setting the variable to a specific value. 22. An AND decision can be constructed using a ____ decision. 23. Misuse of a language’s grammar rules is called a(n) ____ error. 24. The selection structure is also called an if-then structure. 25. What is the correct data type of an accumulator variable used to store real estate sales totals? 26. Which takes precedence when the two are combined in a single statement: AND or OR? 27. Program comments are nonexecuting statements. 28. What is the answer for the following operation: (3+5) * 10 – 4/8 29. A loop for which the number of iterations is predetermined is called a definite loop or counted loop. 30. When you use a subscript not within the range of acceptable subscripts, your subscript is said to be ____. 31. Users enter incorrect data frequently; a good program should be able to handle the mistake and not allow the ____ to be out of bounds. 32. The two major components of any computer system are its hardware and its software. 33. An algorithm is the sequence of steps necessary to solve a problem. 34. Write a program that creates an array with 10 elements and stores the numbers 1 though 10 in the elements then outputs the array in reverse order (element 10 through 1). Use a looping structure for efficient programming to earn full credit. HTML Editor 35. What would be the output of the following expression if the temperature outside is 30 degrees? 36. The body of a loop can contain only a limited number of statements. 37. Many programming languages allow you to use ____ to force an expression to evaluate first. 38. answer = a + b + c * d / e – f 39. Arrays are always composed of elements of the same data ____. 40. The true benefit of using an array lies in your ability to use a variable as a subscript to the array instead of using a constant. 41. Leaving a loop as soon as a match is found ____ a program’s efficiency. 42. When you combine AND and OR operators within the same statement, the AND operators take precedence. 43. What is another word for a subscript? 44. When using a flowchart, input is represented by what geometric shape? 45. Each variable within an array has the same name and the same data type. 46. The structure which takes one of two paths based on a decision is called a(n) ____ structure. 47. Which language does a computer know? |