PLD Semester Exam Study Guide Dec. 2018

Similar documents
Indicate the answer choice that best completes the statement or answers the question. Enter the appropriate word(s) to complete the statement.


Introduction to Computer Science Midterm 3 Fall, Points

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Lecture 7 Tao Wang 1

Repetition Structures

Computer Programming C++ (wg) CCOs


Internet & World Wide Web How to Program, 5/e by Pearson Education, Inc. All Rights Reserved.

Introduction. C provides two styles of flow control:

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution.

A Beginner s Guide to Programming Logic, Introductory. Chapter 5 Looping

Loops and Files. Chapter 04 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz

Computer Programming I - Unit 5 Lecture page 1 of 14

Topics. Introduction to Repetition Structures Often have to write code that performs the same task multiple times. Controlled Loop


Programming for Engineers Iteration

Glossary. For Introduction to Programming Using Python By Y. Daniel Liang

Programming Fundamentals - A Modular Structured Approach using C++ By: Kenneth Leroy Busbee

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

An Introduction to Programming with C++ Sixth Edition. Chapter 7 The Repetition Structure

CS110D: PROGRAMMING LANGUAGE I

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003

Microsoft Visual Basic 2005: Reloaded

19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd

Control Structures II. Repetition (Loops)

APPENDIX E SOLUTION TO CHAPTER SELF-TEST CHAPTER 1 TRUE-FALSE FILL-IN-THE-BLANKS

Lecture 2 Arrays, Searching and Sorting (Arrays, multi-dimensional Arrays)

Programming Logic and Design Sixth Edition

Chapter 3. More Flow of Control. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

In this chapter you ll learn:

Chapter 3 Structured Program Development

Università degli Studi di Bologna Facoltà di Ingegneria. Principles, Models, and Applications for Distributed Systems M

Programming Languages Third Edition. Chapter 9 Control I Expressions and Statements

Introduction to Visual Basic and Visual C++ Arithmetic Expression. Arithmetic Expression. Using Arithmetic Expression. Lesson 4.

In Fig. 3.5 and Fig. 3.7, we include some completely blank lines in the pseudocode for readability. programs into their various phases.

OBJECT ORIENTED SIMULATION LANGUAGE. OOSimL Reference Manual - Part 1

Java How to Program, 9/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Final Examination Semester 3 / Year 2010

REPETITION CONTROL STRUCTURE LOGO

Model Viva Questions for Programming in C lab

Repetition and Loop Statements Chapter 5

Fundamentals of Programming Session 7

5.1. Chapter 5: The Increment and Decrement Operators. The Increment and Decrement Operators. Looping. ++ is the increment operator.

Chapter 8 Statement-Level Control Structures

Introduction to C Final Review Chapters 1-6 & 13

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

COP 2000 Introduction to Computer Programming Mid-Term Exam Review

CPSC 3740 Programming Languages University of Lethbridge. Control Structures

DEPARTMENT OF COMPUTER AND MATHEMATICAL SCIENCES UNIVERSITI TEKNOLOGI MARA CAWANGAN PULAU PINANG

Formal Specification and Verification

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

A Beginner s Guide to Programming Logic, Introductory. Chapter 6 Arrays

Absolute C++ Walter Savitch

Algorithm Discovery and Design

Chapter 8. Statement-Level Control Structures

Conditionals and Loops

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

L o o p s. for(initializing expression; control expression; step expression) { one or more statements }

Repeating Instructions. C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies

Announcements. Lab Friday, 1-2:30 and 3-4:30 in Boot your laptop and start Forte, if you brought your laptop

Programming for the Web with PHP

Review of the C Programming Language for Principles of Operating Systems

Special Section: Building Your Own Compiler

CIS 3260 Intro to Programming in C#

Structured Program Development in C

*Starting Out with C++: From Control Structures through Objects, 7/E* by *Tony Gaddis* COMPUTER PROGRAMMING LECTURE 05 LOOPS IMRAN IHSAN

C-LANGUAGE CURRICULAM

CS112 Lecture: Repetition Statements

Software Engineering using Formal Methods

Review of the C Programming Language

CSc Introduc/on to Compu/ng. Lecture 8 Edgardo Molina Fall 2011 City College of New York

Flow Control. CSC215 Lecture

Chapter 3 Structured Program Development in C Part II

Program Development. Chapter 3: Program Statements. Program Statements. Requirements. Java Software Solutions for AP* Computer Science A 2nd Edition

ECE 122. Engineering Problem Solving with Java

Chapter 3: Program Statements

Control Statements. Musa M. Ameen Computer Engineering Dept.

Programming Logic and Design Sixth Edition

Computer Science 4U Unit 1. Programming Concepts and Skills Algorithms

More on control structures

CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING Chapter 4: Repetition Control Structure

Software Engineering using Formal Methods

Chapter 5: Control Structures II (Repetition) Objectives (cont d.) Objectives. while Looping (Repetition) Structure. Why Is Repetition Needed?

G Programming Languages - Fall 2012

Chapter 6 Repetition. 6.1 Do Loops 6.2 For...Next Loops 6.3 List Boxes and Loops

Problem Solving with C++

Lecture 6 Sorting and Searching

Introduction to Programming Using Java (98-388)

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Pace University. Fundamental Concepts of CS121 1

Multiple Choice (Questions 1 13) 26 Points Select all correct answers (multiple correct answers are possible)

4.1 COMPUTATIONAL THINKING AND PROBLEM-SOLVING

Programming Fundamentals

Control Structures. Control Structures Conditional Statements COMPUTER PROGRAMMING. Electrical-Electronics Engineering Dept.

IUSE Knowledge Test. 1. Demographic Questions. IUSE Knowledge Test. 2. Computational Thinking Knowledge Test

Sorting. Introduction. Classification

The for Loop, Accumulator Variables, Seninel Values, and The Random Class. CS0007: Introduction to Computer Programming

12 Abstract Data Types

Transcription:

Covers material from Chapters 1-8. Semester Exam will be built from these questions and answers, though they will be re-ordered and re-numbered and possibly worded slightly differently than on this study guide. Indicate the answer choice that best completes the statement or answers the question. Solutions appear at the end of the study guide. 1. An array whose elements you can access using a single subscript is a array. a. one-dimensional b. multi-dimensional c. non-dimensional d. single-dimensional 2. Before a programmer plans the logic of the program, he or she must. a. understand the problem b. write the program code c. test the program d. maintain the program 3. A is a collection of data stored on a nonvolatile device in a computer system. a. computer message b. computer interface c. computer file d. computer selector 4. errors are relatively easy to locate and correct because the compiler or interpreter you use highlights every error. a. Logic b. Syntax c. Input d. Process 5. A is a copy that is kept in case values need to be restored to their original state. a. read-only file b. backup file c. primary file d. secondary file 6. You may hear programmers refer to looping as. a. execution b. selection c. iteration d. case 7. A allows users to interact with a program in a graphical environment. a. GCI b. CGI c. command line d. GUI 8. A(n) is a program that you use to create simple text files. a. text editor b. IDE c. GUI d. GDE 9. Programmers say that variables and constants declared within a module are only within that module. a. abstracted b. out of scope c. in scope d. in reference 10. Usually, when you create nested loops, each loop has its own. a. sentinel value b. goto statement c. entrance condition d. loop control variable 11. The amount by which a for loop control variable changes is often called a value. Copyright Cengage Learning. Powered by Cognero. Page 1

a. group b. key c. step d. sentinel 12. Named hold values that do not change during a program s execution. a. constants b. variables c. objects d. items 13. One advantage to using a named constant is that the statement becomes. a. self-perpetuating b. self-documenting c. self-referencing d. self-mitigating 14. The action or actions that occur within a loop are known as a(n). a. loop body b. action body c. loop internals d. structure body 15. Programmers use the term to describe programs that are well designed and easy to understand and maintain. a. industrial b. intractable c. well behaved d. elegant 16. A error results when you use a syntactically correct statement but use the wrong one for the current context. a. syntax b. logical c. semantic d. programming 17. Because they enable you to locate a particular record directly (without reading all of the preceding records), random access files are also called files. a. direct access b. indirect access c. sequential access d. pointed access 18. With a(n), you perform an action or task, and then you perform the next action, in order. a. ordered structure b. sequence problem c. sequence structure d. loop sequence 19. Programmers employ the acronym to mean that if your input is incorrect, your output is worthless. a. IBOW b. GIGO c. IIOW d. GIGS 20. A loop within another loop is known as a(n) loop. a. indefinite b. infinite c. nested d. hidden 21. Usually, variables are not considered to be equal unless they are identical. a. string b. integer c. character d. floating point 22. You can perform a by making comparisons using either the lowest or highest value in a range of values. a. range check b. nested if Copyright Cengage Learning. Powered by Cognero. Page 2

c. logic check d. trivial expression 23. C#, C++, C, and Java use the symbol as the logical OR operator. a. % b. $ c. d. ^ 24. When you search through a list from one end to the other, you are performing a. a. linear search b. binary search c. quadratic search d. single lookup 25. Pseudocode uses the end-structure statement to clearly show where the structure ends. a. end b. endstructure c. endloop d. endif 26. Every array has a(n) size. a. infinite b. finite c. variable d. constant 27. A bubble sort is sometimes called a. a. dropping sort b. sinking sort c. compare sort d. pair sort 28. Programmers say the statements that are contained in a module have been. a. embedded b. decomposed c. encapsulated d. modularized 29. The first step in a while loop is typically to. a. compare the loop control variable to a constant value b. initialize the loop control variable c. increment the loop control variable d. execute the body of the loop 30. In a truth table, the expression is false. a. true OR true b. true OR false c. false OR true d. false OR false 31. A(n) is any numeric variable you use to count the number of times an event has occurred. a. accumulator b. key c. index d. counter 32. When creating a truth table, you must determine how many possible Boolean value combinations exist for the conditions. If there are two conditions, combinations will exist. a. two b. four c. eight d. 16 Copyright Cengage Learning. Powered by Cognero. Page 3

33. if-else examples can also be called because they contain the action taken when the tested condition is true and the action taken when it is false. a. do loops b. single-alternative selections c. repetition d. dual-alternative selections 34. A(n) is a location on your computer screen where you type text entries to communicate with the computer s operating system. a. input line b. communication line c. command line d. GCI 35. When using a bubble sort to sort a 10-element array, on the fourth pass through the array list you detect that no swap has occurred. This indicates. a. the elements in the array were badly out of order b. all elements in the array are already in the correct order c. you must make one more pass through the array d. you must make a total of 10 passes through the array 36. is processing that involves performing the same tasks with many records, one after the other. a. Volume processing b. Batch processing c. Online processing d. Standard processing 37. When you use an index, you can store records on a storage device. a. linear-access b. random-access c. sequential-access d. uniform-access 38. The combination of the disk drive plus the complete hierarchy of directories in which a file resides is its. a. pointer b. path c. locator d. stream 39. The case structure is a variation of the structure. a. selection b. while c. sequence d. do 40. In a, the loop body executes at least one time because the loop control variable is not tested until after one iteration. a. nested loop b. pretest loop c. posttest loop d. loop control 41. When a subscript is not within the range of acceptable subscripts, it is said to be. a. a superscript b. flagged c. out of bounds d. indexed 42. Use a counter or a(n) to control a loop s repetitions. a. sentinel variable b. end value c. sentinel value Copyright Cengage Learning. Powered by Cognero. Page 4

d. end statement 43. When mathematicians use a two-dimensional array, they often call it a or a table. a. vector b. matrix c. square d. grid 44. A(n) is another name for a subscript. a. pointer b. sequence c. index d. place holder 45. Both operands in a comparison expression must be the same. a. value b. name c. length d. data type 46. The file holds temporary data that is used to update the master file. a. directory b. transaction c. merge d. database 47. When the records in a file are sorted in order from lowest to highest values, the records are in order. a. descending b. bubble c. ascending d. merged 48. The process of naming program variables and assigning a type to them is called variables. a. initializing b. declaring c. identifying d. proclaiming Enter the appropriate word(s) to complete the statement. 49. A program in which the user makes direct requests is a(n) program. 50. Program are written explanations that are not part of the program logic but that serve as documentation for readers of the program. 51. tasks include any steps you must perform at the beginning of a program to get ready for the rest of the program. 52. can ensure that a value is the correct data type or that it falls within an acceptable range. 53. When you draw a flowchart, you use a(n) to represent the input symbol, which indicates an input operation. 54. A selection is one in which an action is associated with each of two possible outcomes. 55. When you store data in a computer file on a persistent storage device, you to the file. 56. Use a(n) to indicate the position of a particular item within an array. 57. The clause is the part of the decision that holds the action or actions that execute when the Copyright Cengage Learning. Powered by Cognero. Page 5

tested condition in the decision is true. 58. A(n) is a list of instructions that accomplishes a task. 59. When businesses store data items on computer systems, they are often stored in a framework called the data that describes the relationships between data components. 60. A(n) is a small unit of storage that, for example, holds only one character in a simple text file. 61. When you decisions because the resulting action requires that two conditions be true, you must decide which of the two decisions to make first. 62. Some people call the selection structure a(n) statement. 63. Each programming language has a few reserved that are not allowed as variable names because they are part of the language s syntax. 64. A(n) is the sequence of steps necessary to solve any problem. 65. All array elements have the same name, but each individual element also has a unique subscript indicating how far away it is from the first element. 66. If you are performing a(n) bubble sort, then after you have made one pass through the list, the largest value is guaranteed to be in its correct final position at the bottom of the list. 67. A(n) file holds more temporary data than a master file. 68. A group of statements that execute as a single unit are called a(n). 69. When instructions are carried out, a program runs, or. 70. In an AND decision, first ask the question that is less likely to be. 71. Whole number variables are known as variables. 72. When you values stored in two variables, you exchange their values. 73. are frequently used to accumulate totals and to validate data. 74. The NOT operator is a operator, meaning it takes only one operand. 75. A(n) is a variable set to indicate whether some event has occurred. 76. A(n) can contain any number of tasks, but there is no option to branch off and skip any of the tasks. 77. A(n) programmer would approach a problem by dividing the process into manageable subtasks. 78. In a for statement, a loop control variable is initialized, tested, and. Copyright Cengage Learning. Powered by Cognero. Page 6

79. A preselected value that stops the execution of a program is often called a(n) value because it does not represent real data. 80. Adding to a variable is called the variable. 81. When working with arrays, you can use in several ways: To hold the size of an array, as the array values, and as a subscript. 82. A subscript, also called a(n), is a number that indicates the position of a particular item within an array. 83. A common method of accessing records in logical order is to use a(n). 84. Structured programming is sometimes called -less programming. 85. Declaring a starting value is known as the variable. 86. When one loop appears inside another, the loop that is contained is called the loop. 87. In its simplest form, creating a(n) list involves creating one extra field in every record of stored data. 88. When you structures, the statements that start and end a structure are always on the same level and always in pairs. Match each term with a statement below. a. linear search b. out of bounds c. flag d. parallel arrays e. array f. element g. for loop h. named constant i. binary search j. populating the array 89. A series of values in computer memory 90. Each separate item in an array 91. Providing array values 92. Can hold the size of an array 93. A variable that you set to indicate whether some event has occurred Copyright Cengage Learning. Powered by Cognero. Page 7

94. Starts looking in the middle of a sorted list, and then determines whether it should continue higher or lower 95. Starts searching through a list from one end to the other 96. A subscript that is not within the range of acceptable subscripts 97. A particularly convenient tool when working with arrays because you frequently need to process every element of an array 98. In this type of array, each element in one array is associated with the element in the same relative position in the other array Match each term with a statement below. a. Reliability b. Declaration c. Echoing input d. String variable e. Identifier f. Prompt g. Variables h. Data dictionary i. Numeric variable j. Type-safety 99. Named memory locations whose contents can vary or differ over time 100. A statement that provides a data type and an identifier for a variable Copyright Cengage Learning. Powered by Cognero. Page 8

Answer Key 1. a 2. a 3. c 4. b 5. b 6. c 7. d 8. a 9. c 10. d 11. c 12. a 13. b 14. a 15. d 16. b 17. a 18. c 19. b 20. c 21. a 22. a 23. c 24. a 25. d Copyright Cengage Learning. Powered by Cognero. Page 9

26. b 27. b 28. c 29. b 30. d 31. d 32. b 33. d 34. c 35. b 36. b 37. b 38. b 39. a 40. c 41. c 42. c 43. b 44. c 45. d 46. b 47. c 48. b 49. interactive 50. comments 51. Housekeeping Copyright Cengage Learning. Powered by Cognero. Page 10

House-keeping House keeping housekeeping house-keeping house keeping 52. validation Validation 53. parallelogram 54. dual-alternative dual alternative 55. write 56. subscript 57. if-then if then 58. algorithm 59. hierarchy 60. byte 61. nest 62. if-then-else if then else 63. keywords key words 64. algorithm 65. group 66. ascending 67. transaction 68. block 69. executes 70. true 71. integer Copyright Cengage Learning. Powered by Cognero. Page 11

72. swap 73. Loops loops 74. unary 75. flag 76. sequence 77. procedural 78. altered changed incremented decremented 79. dummy 80. incrementing 81. constants 82. index 83. index linked list 84. goto go to go-to 85. initializing 86. inner nested 87. linked 88. nest 89. e 90. f 91. j 92. h 93. c Copyright Cengage Learning. Powered by Cognero. Page 12

94. i 95. a 96. b 97. g 98. d 99. g 100. b Copyright Cengage Learning. Powered by Cognero. Page 13