Chapter Six



INT1111: Quiz 08 (Chapter Eight) Name --------------------------------------------

Multiple Choice

1. Processing a large number of items in a(n) ________ is usually easier than processing a large number of items stored in separate variables.

|a. |Constant |

|b. |Variable |

|c. |Array |

|d. |Loop |

|e. |None of the above |

2. What is the term used for the number inside the bracket that specifies the number of values that an array can hold?

|a. |Size |

|b. |Size declarator |

|c. |Number |

|d. |Number declarator |

|e. |None of the above |

3. Access the individual elements in an array by using their _____________.

|a. |Sizes |

|b. |Numbers |

|c. |Integers |

|d. |Subscripts |

|e. |None of the above |

4. A partially filled array is normally used with __________.

|a. |a library function that performs array insertions |

|b. |an accompanying variable that holds a copy of the last item stored in the array |

|c. |an accompanying integer variable that holds the number of items that are actually stored in the array |

|d. |a warning to the user that some of the elements contain invalid values |

|e. |None of the above |

5. Some programming languages provide this specialized loop that steps through an array, retrieving the value of each element.

|a. |While Each |

|b. |For Each |

|c. |Repeat Get |

|d. |Step Loop |

|e. |None of the above |

6. Which is the simplest search technique to use to find an item in an array?

|a. |Sequential |

|b. |Binary |

|c. |Bubble |

|d. |Select |

|e. |None of the above |

7. Which of the following arguments must be passed when passing an array as an argument?

|a. |The array itself |

|b. |An integer that specifies the number of elements in the array |

|c. |The data type of the array |

|d. |A and B |

|e. |A and C |

8. ________________ arrays are two or more arrays that hold related data, and the elements are accessed using a common subscript.

|a. |Sequential |

|b. |Binary |

|c. |Parallel |

|d. |Linear |

|e. |None of the above |

9. How many subscripts do you need to access one element in a two-dimensional array?

|a. |One |

|b. |Two |

|c. |Three |

|d. |Four |

|e. |None of the above |

10. Two- dimensional arrays can be thought of as containing ___________.

|a. |Rows and columns |

|b. |Lines and pages |

|c. |Rows and pages |

|d. |Lines and columns |

|e. |Rows and pages |

11. A three-dimensional array can be thought of as ______ of two-dimensional arrays.

|a. |Rows |

|b. |Columns |

|c. |Lines |

|d. |Pages |

|e. |None of the above |

12. In the following declaration, what is the data type of the elements of the array?

Declare Integer numbers [SIZE]

|a. |SIZE |

|b. |numbers |

|c. |Integer |

|d. |Declare |

|e. |None of the above |

13. Every element in an array is assigned a unique number known as a ______________.

|a. |subscript |

|b. |integer |

|c. |character |

|d. |number |

|e. |None of the above |

14. Which of the following statement is true about the statement below?

Declare Integer score [5] = 83, 92, 78, 94, 71

|a. |This is an array declaration. |

|b. |This is an array initialization. |

|c. |This is an array size establishment. |

|d. |This is an array declaration and initialization. |

|e. |This is an array declaration and size establishment. |

15. What is the subscript for the data value 92 in the example given below?

Declare Integer score [5] = 83, 92, 78, 94, 71

|a. |One |

|b. |Two |

|c. |A |

|d. |B |

|e. |None of the above |

16. What is the term used for the value that is searched for in a search algorithm?

|a. |stringValue |

|b. |searchValue |

|c. |matchValue |

|d. |flag |

|e. |None of the above |

17. The expression score[5] is pronounced _____________________.

|a. |Score of 5 |

|b. |Score 5 |

|c. |Score sub 5 |

|d. |Score of 4 |

|e. |Score sub 4 |

True/False

18. True/False: Subscripts are used to identify specific elements in an array.

19 True/False: Unlike variables, arrays need to be initialized separately from the declaration.

20. True/False: Array bounds checking happens at runtime, which is while the program is running.

21. True/False: In a sequential search algorithm, the Boolean variable used as a flag is initialized to TRUE.

22. True/False: The first step in calculating the average of the values in an array is to get the total of the values.

23. True/False: If array name contains a list of names, name[1] is the name of the first person.

24. True/False: When processing the data in a two-dimensional array, each element has two subscripts.

25. True/False: Multiple-dimensional arrays can be used to model data that occurs in multiple sets.

Multiple Choice

1. Which sorting algorithm moves elements to their final sorted position in the array?

|a. |Bubble |

|b. |Selection |

|c. |Insertion |

|d. |Hash |

|e. |None of the above |

2. When the elements in an array are stored from lowest to highest, the array is sorted in __________ order.

|a. |Ascending |

|b. |Descending |

|c. |Numeric |

|d. |Alphabetic |

|e. |None of the above |

3. As the __________sorting algorithm makes passes through and compares the elements of the array, certain values move toward the end of the array with each pass.

|a. |Bubble |

|b. |Selection |

|c. |Insertion |

|d. |Hash |

|e. |None of the above |

4. Which searching algorithm requires the array to be ordered?

|a. |Sequential |

|b. |Binary |

|c. |Linear |

|d. |Parallel |

|e. |None of the above |

5. Which sorting algorithm sorts the first two elements of an array before inserting the remaining elements into that sorted part of the array?

|a. |Bubble |

|b. |Selection |

|c. |Insertion |

|d. |Hash |

|e. |None of the above |

6. Which search algorithm uses three variables to mark positions within the array as it searches for the searchValue?

|a. |Sequential |

|b. |Binary |

|c. |Parallel |

|d. |Linear |

|e. |None of the above |

7. Which statement is true after the execution of the following statements?

Set x = y

Set y = x

|a. |x and y contain their original values |

|b. |x and y swapped their values |

|c. |x contains the value in y and y stayed the same |

|d. |y contains the value in x and x stayed the same |

|e. |None of the above |

8. In the bubble sort algorithm, the two arguments sent into the swap module are ___________.

|a. |array[index] and array[index-1] |

|b. |array[index+1] and array[index-1] |

|c. |array[index-1] and array[index+1] |

|d. |array[index-1] and array[index] |

|e. |None of the above |

9. Which statement is true after the execution of the following statements?

Set t = x

Set x = y

Set y = t

|a. |x and y contain their original values |

|b. |x and y swapped their values |

|c. |x contains the value in y and y stayed the same |

|d. |y contains the value in x and x stayed the same |

|e. |None of the above |

10. In the swap module, the third variable is declared as a __________ variable.

|a. |Global |

|b. |Reference |

|c. |Local |

|d. |Constant |

|e. |None of the above |

11. In an insertion sort, what order are the elements in an array placed using the following Boolean expression?

// variable p is used to scan the array

While p > 0 AND array[p-1] > array[p]

|a. |Ascending |

|b. |Descending |

|c. |Numeric |

|d. |Alphabetic |

|e. |None of the above |

12. What does the variable middle represent in a binary search algorithm?

|a. |Subscript of the midpoint |

|b. |Middle value in the array |

|c. |Middle value in the portion to be searched |

|d. |The average of two values |

|e. |None of the above |

13. In a binary search, what is the maximum number of comparisons that need to be performed if the array contained 1000 elements?

|a. |1000 |

|b. |500 |

|c. |250 |

|d. |100 |

|e. |None of the above |

14. In a selection sort, which variable holds the subscript of the element with the smallest value found in the scanned area of the array?

|a. |minIndex |

|b. |minValue |

|c. |startScan |

|d. |SIZE |

|e. |None of the above |

15. To order an array of strings in alphabetic order, the sorting algorithm should be structured for ____________ order.

|a. |alphabetic |

|b. |numeric |

|c. |ascending |

|d. |descending |

|e. |None of the above |

True/False

16 True/False: Swapping the contents of two variables requires a third variable that can serve as a temporary storage location.

17. True/False: The sequential search algorithm is simple and most efficient to use with a large data array.

18. True/False: Computer programming languages are only able to perform sort algorithms on numeric arrays.

19. True/False: The biggest advantage of the bubble sort algorithm is that values move only by one element at a time toward their final destination in the array.

20. True/False: In a binary search, if the search fails to find the item on the first attempt, then there are 999 elements left to search in an array of 1000 elements.

21. True/False: When values in an array need to be swapped, the array and the size of the array have to be sent to the swap module.

22. True/False: In a sequential search, each element is compared to the searchValue and the search stops when the value is found or the end of the array is encountered.

23. True/False: The swap module is executed with three arguments to correctly swap the elements in an array.

24. True/False: In a selection sort algorithm, the variable minValue holds the smallest value found in the scanned area of the array.

25. True/False: All sorting algorithms contain a group of statements that swap values in array elements.

1. A list of operations that is displayed on the screen is called a(n) _______________.

|a. |List |

|b. |Menu |

|c. |Option list |

|d. |Choice list |

|e. |None of the above |

2. The acronym GUI stands for _____________.

|a. |Graphical user instrument |

|b. |Graphics uses interface |

|c. |Graphics uses instrument |

|d. |Graphical user interface |

|e. |None of the above |

3. What is the structure that is needed to process a menu selection?

|a. |Sequence |

|b. |Decision |

|c. |Iteration |

|d. |Loop |

|e. |None of the above |

4. Which statement provides a Default section to validate the user’s menu selection?

|a. |If-Then |

|b. |If-Then-Else |

|c. |If-Then-Else If |

|d. |Case |

|e. |None of the above |

5. A(n) _______ program always starts off by displaying a list of operations the user can select from.

|a. |Menu-driven |

|b. |Interactive |

|c. |Graphical |

|d. |User-friendly |

|e. |None of the above |

6. Which loop is a posttest loop such that the menu is displayed at least once?

|a. |Do-While |

|b. |While |

|c. |For |

|d. |Any of the above |

|e. |None of the above |

7. What type of menu first displays the main menu and then, based on the user’s selection, displays a submenu?

|a. |Single-level menu |

|b. |Multiple-level menu |

|c. |Step-level menu |

|d. |Sub-level menu |

|e. |None of the above |

8. Menu-driven programs should be broken down into ________ that perform individual tasks.

|a. |loops |

|b. |functions |

|c. |tasks |

|d. |modules |

|e. |None of the above |

9. What is capable of performing several tasks and allows the user to select the task?

|a. |Menu-driven programs |

|b. |Interactive programs |

|c. |Graphical programs |

|d. |User-friendly programs |

|e. |None of the above |

10. What is the method used to make sure that valid selections are processed?

|a. |Input validation loop |

|b. |Including the Default clause in the case structure |

|c. |Use of an Else clause |

|d. |All of the above |

|e. |None of the above |

11. The items displayed in a menu are often preceded by a __________.

|a. |Number |

|b. |Letter |

|c. |Other characters |

|d. |Any of the above |

|e. |None of the above |

12. When the user makes a selection from the main menu in a multiple-level menu, a ______ might be displayed next.

|a. |Menu |

|b. |Main menu |

|c. |Grand menu |

|d. |Submenu |

|e. |None of the above |

13. When the user is ready to stop the program, the user selects an operation such as “__________” from the menu.

|a. |STOP |

|b. |CTRL + Z |

|c. |CTRL + X |

|d. |CTRL + Q |

|e. |End of Program |

14. Which symbol in flowcharting is appropriate to use to represent the display of each of the selections of the menu?

|a. |Rectangle |

|b. |Parallelogram |

|c. |Diamond |

|d. |Terminal |

|e. |None of the above |

15. Usually a submenu is executed by the selection made by the user from the _________ .

|a. |Module |

|b. |Case structure |

|c. |Display |

|d. |Main menu |

|e. |None of the above |

True/False

16. True/False: An iteration structure is needed to process the menu selection made by the user.

17. True/False: The If-Then-Else If statement can be used as an alternative for performing the user’s menu selection.

18. True/False: The user’s menu selection can be validated using an input validation loop immediately after the Input statements.

19. True/False: It is not possible to give the user an opportunity to make additional selections from the menu without having to run the program.

20. True/False: When using a While loop to repeatedly process a user’s menu selections, the menuSelection variable need to be initialized.

21. True/False: It is ideal to have one long menu in the program for users to see and make their selection.

22. True/False: Modules cannot be executed from a case statement, so loops have to be used.

23. True/False: When there is an input validation loop, the case structure does not need the Default clause.

24. True/False: It is a cumbersome process for a user has to make selection from a menu because the user has to type the selection out.

25. True/False: In a menu-driven program the user would have to usually type the word ‘end’ to stop the program.

1. Which interface allows the user to interact with the operating system and other programs using graphical elements?

|a. |Graphical menu |

|b. |Graphical screen |

|c. |Graphical user |

|d. |Graphical program |

|e. |None of the above |

2. What type of interface displays a prompt, and the user types a command which is then executed?

|a. |Command line |

|b. |Command prompt |

|c. |Command type |

|d. |Command display |

|e. |None of the above |

3. The __________ are small windows that display information and allow the user to perform actions.

|a. |Dialog boxes |

|b. |Communication boxes |

|c. |Dialog windows |

|d. |Dialog boxes |

|e. |None of the above |

4. What is the term used when a GUI program responds to the actions of the user?

|a. |Dialog-driven |

|b. |Icon-driven |

|c. |Menu-driven |

|d. |Event-driven |

|e. |None of the above |

5. The GUI components are known as _________________ and widgets.

|a. |fields |

|b. |controls |

|c. |records |

|d. |buttons |

|e. |None of the above |

6. GUI components have a set of _______________ that determine how the component appears on the screen.

|a. |Rules |

|b. |Properties |

|c. |Logic |

|d. |Procedures |

|e. |None of the above |

7. What is the term used for the code that responds to events and allows a GUI program to respond to an event?

|a. |Event code |

|b. |Event handler |

|c. |Event program |

|d. |Action handler |

|e. |Action code |

8. What GUI component should be used if the user wants an area in which to type a single line of input from the keyboard?

|a. |Text box |

|b. |Label |

|c. |Combo box |

|d. |List box |

|e. |Slider |

9. A component’s ______________ control the visual characteristics that are displayed on the component.

|a. |Data |

|b. |Fields |

|c. |Properties |

|d. |Specifiers |

|e. |None of the above |

10. The items that appear in a program’s graphical user interface are known as _______________.

|a. |Components |

|b. |Buttons |

|c. |Shapes |

|d. |Lists |

|e. |None of the above |

11. What is the acronym that is often referred to as “gooey”?

|a. |GOEE |

|b. |GUIE |

|c. |GUE |

|d. |GUI |

|e. |None of the above |

12. A user interface _________ diagram assists the programmer in depicting the flow from one window to another in a GUI program.

|a. |data |

|b. |flow |

|c. |GUI |

|d. |text |

|e. |None of the above |

13. Many computer users, especially beginners, find _________________ interfaces difficult to use.

|a. |Command line |

|b. |Graphical user |

|c. |Graphical line |

|d. |Command User |

|e. |None of the above |

14. Which component usually appears in groups and allows the user to select one of several options?

|a. |Text box |

|b. |Slider |

|c. |Combo box |

|d. |List box |

|e. |Radio button |

15. A component that displays a drop-down list of items from which the user may select and provides a text box is known as a _____________________.

|a. |Text box |

|b. |Label |

|c. |Combo box |

|d. |List box |

|e. |None of the above |

True/False

16. True/False: Most people find command line interfaces easy to use as the commands are displayed very clearly.

17. True/False: If the operating system uses GUI, then the programmer can incorporate GUI elements into their program.

18. True/False: In a GUI environment, the user determines the order in which things happen.

19. True/False: Using an IDE, a window can be created by clicking on the desired item in the toolbox and then clicking in the window to place it.

20. True/False: In a user interface flow diagram, an arrow appears between two windows in the diagram when actions performed in one window can cause another window to open.

21. True/False: The label is a component in which the user can input text from the keyboard.

22. True/False: When creating a GUI program, the programmer must design the program’s windows and all of the text components that appear in them.

23. True/False: If an event occurs and there is no event handler to respond to that event, the event is ignored.

24. True/False: Some of the common GUI components are class, object, methods, and fields.

25. True/False: The IDE usually allows the programmer to construct a window and its graphical elements visually without a single line of code.

................
................

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

Google Online Preview   Download