PLD Semester Exam Study Guide Dec. 2018

Size: px
Start display at page:

Download "PLD Semester Exam Study Guide Dec. 2018"

Transcription

1 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

2 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

3 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

4 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

5 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

6 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

7 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

8 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

9 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

10 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

11 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

12 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

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

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

Indicate the answer choice that best completes the statement or answers the question. Enter the appropriate word(s) to complete the statement. 1. C#, C++, C, and Java use the symbol as the logical OR operator. a. $ b. % c. ^ d. 2. errors are relatively easy to locate and correct because the compiler or interpreter you use highlights every error.

More information

Page 1 of 14 Version A Midterm Review 1. The sign means greater than. > =

More information

Introduction to Computer Science Midterm 3 Fall, Points

Introduction to Computer Science Midterm 3 Fall, Points Introduction to Computer Science Fall, 2001 100 Points Notes 1. Tear off this sheet and use it to keep your answers covered at all times. 2. Turn the exam over and write your name next to the staple. Do

More information

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

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved. Assoc. Prof. Dr. Marenglen Biba Before writing a program to solve a problem, have a thorough understanding of the problem and a carefully planned approach to solving it. Understand the types of building

More information

Lecture 7 Tao Wang 1

Lecture 7 Tao Wang 1 Lecture 7 Tao Wang 1 Objectives In this chapter, you will learn about: Interactive loop break and continue do-while for loop Common programming errors Scientists, Third Edition 2 while Loops while statement

More information

Repetition Structures

Repetition Structures Repetition Structures Chapter 5 Fall 2016, CSUS Introduction to Repetition Structures Chapter 5.1 1 Introduction to Repetition Structures A repetition structure causes a statement or set of statements

More information

Computer Programming C++ (wg) CCOs

Computer Programming C++ (wg) CCOs Computer Programming C++ (wg) CCOs I. The student will analyze the different systems, and languages of the computer. (SM 1.4, 3.1, 3.4, 3.6) II. The student will write, compile, link and run a simple C++

More information

https://asd-pa.perfplusk12.com/admin/admin_curric_maps_display.aspx?m=5507&c=618&mo=18917&t=191&sy=2012&bl...

https://asd-pa.perfplusk12.com/admin/admin_curric_maps_display.aspx?m=5507&c=618&mo=18917&t=191&sy=2012&bl... Page 1 of 13 Units: - All - Teacher: ProgIIIJavaI, CORE Course: ProgIIIJavaI Year: 2012-13 Intro to Java How is data stored by a computer system? What does a compiler do? What are the advantages of using

More information

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

Internet & World Wide Web How to Program, 5/e by Pearson Education, Inc. All Rights Reserved. Internet & World Wide Web How to Program, 5/e Sequential execution Execute statements in the order they appear in the code Transfer of control Changing the order in which statements execute All scripts

More information

Introduction. C provides two styles of flow control:

Introduction. C provides two styles of flow control: Introduction C provides two styles of flow control: Branching Looping Branching is deciding what actions to take and looping is deciding how many times to take a certain action. Branching constructs: if

More information

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

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution. Repetition Structures Introduction to Repetition Structures Chapter 5 Spring 2016, CSUS Chapter 5.1 Introduction to Repetition Structures The Problems with Duplicate Code A repetition structure causes

More information

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

A Beginner s Guide to Programming Logic, Introductory. Chapter 5 Looping A Beginner s Guide to Programming Logic, Introductory Chapter 5 Looping Objectives In this chapter, you will learn about: The advantages of looping Using a loop control variable Nested loops Avoiding common

More information

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

Loops and Files. Chapter 04 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Loops and Files Chapter 04 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Chapter Topics o The Increment and Decrement Operators o The while Loop o Shorthand Assignment Operators o The do-while

More information

Computer Programming I - Unit 5 Lecture page 1 of 14

Computer Programming I - Unit 5 Lecture page 1 of 14 page 1 of 14 I. The while Statement while, for, do Loops Note: Loop - a control structure that causes a sequence of statement(s) to be executed repeatedly. The while statement is one of three looping statements

More information

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

Topics. Introduction to Repetition Structures Often have to write code that performs the same task multiple times. Controlled Loop Topics C H A P T E R 4 Repetition Structures Introduction to Repetition Structures The for Loop: a Count- Sentinels Nested Loops Introduction to Repetition Structures Often have to write code that performs

More information

https://asd-pa.perfplusk12.com/admin/admin_curric_maps_display.asp...

https://asd-pa.perfplusk12.com/admin/admin_curric_maps_display.asp... 1 of 8 8/27/2014 2:15 PM Units: Teacher: ProgIIIAPCompSci, CORE Course: ProgIIIAPCompSci Year: 2012-13 Computer Systems This unit provides an introduction to the field of computer science, and covers the

More information

Programming for Engineers Iteration

Programming for Engineers Iteration Programming for Engineers Iteration ICEN 200 Spring 2018 Prof. Dola Saha 1 Data type conversions Grade average example,-./0 class average = 23450-67 893/0298 Grade and number of students can be integers

More information

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

Glossary. For Introduction to Programming Using Python By Y. Daniel Liang Chapter 1 Glossary For Introduction to Programming Using Python By Y. Daniel Liang.py Python script file extension name. assembler A software used to translate assemblylanguage programs into machine code.

More information

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

Programming Fundamentals - A Modular Structured Approach using C++ By: Kenneth Leroy Busbee 1 0 1 0 Foundation Topics 1 0 Chapter 1 - Introduction to Programming 1 1 Systems Development Life Cycle N/A N/A N/A N/A N/A N/A 1-8 12-13 1 2 Bloodshed Dev-C++ 5 Compiler/IDE N/A N/A N/A N/A N/A N/A N/A

More information

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

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University Unit 1 Programming Language and Overview of C 1. State whether the following statements are true or false. a. Every line in a C program should end with a semicolon. b. In C language lowercase letters are

More information

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

An Introduction to Programming with C++ Sixth Edition. Chapter 7 The Repetition Structure An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure Objectives Differentiate between a pretest loop and a posttest loop Include a pretest loop in pseudocode Include

More information

CS110D: PROGRAMMING LANGUAGE I

CS110D: PROGRAMMING LANGUAGE I CS110D: PROGRAMMING LANGUAGE I Computer Science department Lecture 5&6: Loops Lecture Contents Why loops?? While loops for loops do while loops Nested control structures Motivation Suppose that you need

More information

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

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003 Control Flow COMS W1007 Introduction to Computer Science Christopher Conway 3 June 2003 Overflow from Last Time: Why Types? Assembly code is typeless. You can take any 32 bits in memory, say this is an

More information

Microsoft Visual Basic 2005: Reloaded

Microsoft Visual Basic 2005: Reloaded Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 4 Making Decisions in a Program Objectives After studying this chapter, you should be able to: Include the selection structure in pseudocode

More information

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

19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd 19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd Will you walk a little faster? said a whiting to a snail, There s a porpoise close behind us, and he s treading

More information

Control Structures II. Repetition (Loops)

Control Structures II. Repetition (Loops) Control Structures II Repetition (Loops) Why Is Repetition Needed? How can you solve the following problem: What is the sum of all the numbers from 1 to 100 The answer will be 1 + 2 + 3 + 4 + 5 + 6 + +

More information

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

APPENDIX E SOLUTION TO CHAPTER SELF-TEST CHAPTER 1 TRUE-FALSE FILL-IN-THE-BLANKS APPENDIX E SOLUTION TO CHAPTER SELF-TEST CHAPTER 1 2. F The AS/400 family of computers, as with all IBM midrange and mainframe computers, uses the EBCDIC coding system. 3. F Arrival sequence files do not

More information

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

Lecture 2 Arrays, Searching and Sorting (Arrays, multi-dimensional Arrays) Lecture 2 Arrays, Searching and Sorting (Arrays, multi-dimensional Arrays) In this lecture, you will: Learn about arrays Explore how to declare and manipulate data into arrays Understand the meaning of

More information

Programming Logic and Design Sixth Edition

Programming Logic and Design Sixth Edition Objectives Programming Logic and Design Sixth Edition Chapter 4 Making Decisions In this chapter, you will learn about: Evaluating Boolean expressions to make comparisons The relational comparison operators

More information

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

Chapter 3. More Flow of Control. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 More Flow of Control Overview 3.1 Using Boolean Expressions 3.2 Multiway Branches 3.3 More about C++ Loop Statements 3.4 Designing Loops Slide 3-3 Flow Of Control Flow of control refers to the

More information

In this chapter you ll learn:

In this chapter you ll learn: Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd Will you walk a little faster? said a whiting to a snail, There s a porpoise close behind us, and he s treading on

More information

Chapter 3 Structured Program Development

Chapter 3 Structured Program Development 1 Chapter 3 Structured Program Development Copyright 2007 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 3 - Structured Program Development Outline 3.1 Introduction

More information

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

Università degli Studi di Bologna Facoltà di Ingegneria. Principles, Models, and Applications for Distributed Systems M Università degli Studi di Bologna Facoltà di Ingegneria Principles, Models, and Applications for Distributed Systems M Control Structures Intro. Sequential execution Statements are normally executed one

More information

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

Programming Languages Third Edition. Chapter 9 Control I Expressions and Statements Programming Languages Third Edition Chapter 9 Control I Expressions and Statements Objectives Understand expressions Understand conditional statements and guards Understand loops and variation on WHILE

More information

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

Introduction to Visual Basic and Visual C++ Arithmetic Expression. Arithmetic Expression. Using Arithmetic Expression. Lesson 4. Introduction to Visual Basic and Visual C++ Arithmetic Expression Lesson 4 Calculation I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Arithmetic Expression Using Arithmetic Expression Calculations

More information

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

In Fig. 3.5 and Fig. 3.7, we include some completely blank lines in the pseudocode for readability. programs into their various phases. Formulating Algorithms with Top-Down, Stepwise Refinement Case Study 2: Sentinel-Controlled Repetition In Fig. 3.5 and Fig. 3.7, we include some completely blank lines in the pseudocode for readability.

More information

OBJECT ORIENTED SIMULATION LANGUAGE. OOSimL Reference Manual - Part 1

OBJECT ORIENTED SIMULATION LANGUAGE. OOSimL Reference Manual - Part 1 OBJECT ORIENTED SIMULATION LANGUAGE OOSimL Reference Manual - Part 1 Technical Report TR-CSIS-OOPsimL-1 José M. Garrido Department of Computer Science Updated November 2014 College of Computing and Software

More information

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

Java How to Program, 9/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 9/e Copyright 1992-2012 by Pearson Education, Inc. All Rights Reserved. Copyright 1992-2012 by Pearson Copyright 1992-2012 by Pearson Before writing a program to solve a problem, have

More information

Final Examination Semester 3 / Year 2010

Final Examination Semester 3 / Year 2010 Southern College Kolej Selatan 南方学院 Final Examination Semester 3 / Year 2010 COURSE : PROGRAMMING LOGIC AND DESIGN COURSE CODE : CCIS1003 TIME : 2 1/2 HOURS DEPARTMENT : COMPUTER SCIENCE LECTURER : LIM

More information

REPETITION CONTROL STRUCTURE LOGO

REPETITION CONTROL STRUCTURE LOGO CSC 128: FUNDAMENTALS OF COMPUTER PROBLEM SOLVING REPETITION CONTROL STRUCTURE 1 Contents 1 Introduction 2 for loop 3 while loop 4 do while loop 2 Introduction It is used when a statement or a block of

More information

Model Viva Questions for Programming in C lab

Model Viva Questions for Programming in C lab Model Viva Questions for Programming in C lab Title of the Practical: Assignment to prepare general algorithms and flow chart. Q1: What is a flowchart? A1: A flowchart is a diagram that shows a continuous

More information

Repetition and Loop Statements Chapter 5

Repetition and Loop Statements Chapter 5 Repetition and Loop Statements Chapter 5 1 Chapter Objectives To understand why repetition is an important control structure in programming To learn about loop control variables and the three steps needed

More information

Fundamentals of Programming Session 7

Fundamentals of Programming Session 7 Fundamentals of Programming Session 7 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Fall 2014 These slides have been created using Deitel s slides Sharif University of Technology Outlines

More information

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

5.1. Chapter 5: The Increment and Decrement Operators. The Increment and Decrement Operators. Looping. ++ is the increment operator. Chapter 5: Looping 5.1 The Increment and Decrement Operators Copyright 2009 Pearson Education, Inc. Copyright Publishing as Pearson 2009 Addison-Wesley Pearson Education, Inc. Publishing as Pearson Addison-Wesley

More information

Chapter 8 Statement-Level Control Structures

Chapter 8 Statement-Level Control Structures Chapter 8 Statement-Level Control Structures In Chapter 7, the flow of control within expressions, which is governed by operator associativity and precedence rules, was discussed. This chapter discusses

More information

Introduction to C Final Review Chapters 1-6 & 13

Introduction to C Final Review Chapters 1-6 & 13 Introduction to C Final Review Chapters 1-6 & 13 Variables (Lecture Notes 2) Identifiers You must always define an identifier for a variable Declare and define variables before they are called in an expression

More information

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

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

COP 2000 Introduction to Computer Programming Mid-Term Exam Review

COP 2000 Introduction to Computer Programming Mid-Term Exam Review he exam format will be different from the online quizzes. It will be written on the test paper with questions similar to those shown on the following pages. he exam will be closed book, but students can

More information

CPSC 3740 Programming Languages University of Lethbridge. Control Structures

CPSC 3740 Programming Languages University of Lethbridge. Control Structures Control Structures A control structure is a control statement and the collection of statements whose execution it controls. Common controls: selection iteration branching Control Structures 1 15 Howard

More information

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

DEPARTMENT OF COMPUTER AND MATHEMATICAL SCIENCES UNIVERSITI TEKNOLOGI MARA CAWANGAN PULAU PINANG DEPARTMENT OF COMPUTER AND MATHEMATICAL SCIENCES UNIVERSITI TEKNOLOGI MARA CAWANGAN PULAU PINANG PROGRAMME Diploma in Civil Engineering Diploma in Mechanical Engineering COURSE/CODE Fundamentals of Computer

More information

Formal Specification and Verification

Formal Specification and Verification Formal Specification and Verification Introduction to Promela Bernhard Beckert Based on a lecture by Wolfgang Ahrendt and Reiner Hähnle at Chalmers University, Göteborg Formal Specification and Verification:

More information

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

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines. Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

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

A Beginner s Guide to Programming Logic, Introductory. Chapter 6 Arrays A Beginner s Guide to Programming Logic, Introductory Chapter 6 Arrays Objectives In this chapter, you will learn about: Arrays and how they occupy computer memory Manipulating an array to replace nested

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

Algorithm Discovery and Design

Algorithm Discovery and Design Algorithm Discovery and Design Chapter 2 The Algorithmic Foundations of Computer Science Algorithms Algorithm Step-by-step method for accomplishing some task Operations used to construct algorithms Sequential,

More information

Chapter 8. Statement-Level Control Structures

Chapter 8. Statement-Level Control Structures Chapter 8 Statement-Level Control Structures Levels of Control Flow Within expressions Among program units Among program statements Copyright 2012 Addison-Wesley. All rights reserved. 1-2 Control Structure

More information

Conditionals and Loops

Conditionals and Loops Conditionals and Loops Conditionals and Loops Now we will examine programming statements that allow us to: make decisions repeat processing steps in a loop Chapter 5 focuses on: boolean expressions conditional

More information

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

UNIT-II. Part-2: CENTRAL PROCESSING UNIT Page1 UNIT-II Part-2: CENTRAL PROCESSING UNIT Stack Organization Instruction Formats Addressing Modes Data Transfer And Manipulation Program Control Reduced Instruction Set Computer (RISC) Introduction:

More information

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

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved. Assoc. Prof. Dr. Marenglen Biba (C) 2010 Pearson Education, Inc. All for repetition statement do while repetition statement switch multiple-selection statement break statement continue statement Logical

More information

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

L o o p s. for(initializing expression; control expression; step expression) { one or more statements } L o o p s Objective #1: Explain the importance of loops in programs. In order to write a non trivial computer program, you almost always need to use one or more loops. Loops allow your program to repeat

More information

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

Repeating Instructions. C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies 6 Repeating Instructions C# Programming: From Problem Analysis to Program Design 2nd Edition David McDonald, Ph.D. Director of Emerging Technologies Chapter Objectives Learn why programs use loops Write

More information

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

Announcements. Lab Friday, 1-2:30 and 3-4:30 in Boot your laptop and start Forte, if you brought your laptop Announcements Lab Friday, 1-2:30 and 3-4:30 in 26-152 Boot your laptop and start Forte, if you brought your laptop Create an empty file called Lecture4 and create an empty main() method in a class: 1.00

More information

Programming for the Web with PHP

Programming for the Web with PHP Aptech Ltd Version 1.0 Page 1 of 11 Table of Contents Aptech Ltd Version 1.0 Page 2 of 11 Abstraction Anonymous Class Apache Arithmetic Operators Array Array Identifier arsort Function Assignment Operators

More information

Review of the C Programming Language for Principles of Operating Systems

Review of the C Programming Language for Principles of Operating Systems Review of the C Programming Language for Principles of Operating Systems Prof. James L. Frankel Harvard University Version of 7:26 PM 4-Sep-2018 Copyright 2018, 2016, 2015 James L. Frankel. All rights

More information

Special Section: Building Your Own Compiler

Special Section: Building Your Own Compiler cshtp6_19_datastructures_compiler.fm Page 1 Tuesday, February 14, 2017 10:31 AM 1 Chapter 19 Special Section: Building Your Own Compiler In Exercises8.31 8.33, we introduced Simpletron Machine Language

More information

CIS 3260 Intro to Programming in C#

CIS 3260 Intro to Programming in C# Iteration (looping) McGraw-Hill 2010 The McGraw-Hill Companies, Inc. All rights reserved. Understand the necessity of this program control structure Describe while loops Describe do while loops Describe

More information

Structured Program Development in C

Structured Program Development in C 1 3 Structured Program Development in C 3.2 Algorithms 2 Computing problems All can be solved by executing a series of actions in a specific order Algorithm: procedure in terms of Actions to be executed

More information

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

*Starting Out with C++: From Control Structures through Objects, 7/E* by *Tony Gaddis* COMPUTER PROGRAMMING LECTURE 05 LOOPS IMRAN IHSAN PowerPoint Slides adapted from *Starting Out with C++: From Control Structures through Objects, 7/E* by *Tony Gaddis* Copyright 2012 Pearson Education Inc. COMPUTER PROGRAMMING LECTURE 05 LOOPS IMRAN IHSAN

More information

C-LANGUAGE CURRICULAM

C-LANGUAGE CURRICULAM C-LANGUAGE CURRICULAM Duration: 2 Months. 1. Introducing C 1.1 History of C Origin Standardization C-Based Languages 1.2 Strengths and Weaknesses Of C Strengths Weaknesses Effective Use of C 2. C Fundamentals

More information

CS112 Lecture: Repetition Statements

CS112 Lecture: Repetition Statements CS112 Lecture: Repetition Statements Objectives: Last revised 2/18/05 1. To explain the general form of the java while loop 2. To introduce and motivate the java do.. while loop 3. To explain the general

More information

Software Engineering using Formal Methods

Software Engineering using Formal Methods Software Engineering using Formal Methods Introduction to Promela Wolfgang Ahrendt & Richard Bubel & Reiner Hähnle & Wojciech Mostowski 31 August 2011 SEFM: Promela /GU 110831 1 / 35 Towards Model Checking

More information

Review of the C Programming Language

Review of the C Programming Language Review of the C Programming Language Prof. James L. Frankel Harvard University Version of 11:55 AM 22-Apr-2018 Copyright 2018, 2016, 2015 James L. Frankel. All rights reserved. Reference Manual for the

More information

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

CSc Introduc/on to Compu/ng. Lecture 8 Edgardo Molina Fall 2011 City College of New York CSc 10200 Introduc/on to Compu/ng Lecture 8 Edgardo Molina Fall 2011 City College of New York 18 The Null Statement Null statement Semicolon with nothing preceding it ; Do-nothing statement required for

More information

Flow Control. CSC215 Lecture

Flow Control. CSC215 Lecture Flow Control CSC215 Lecture Outline Blocks and compound statements Conditional statements if - statement if-else - statement switch - statement? : opertator Nested conditional statements Repetitive statements

More information

Chapter 3 Structured Program Development in C Part II

Chapter 3 Structured Program Development in C Part II Chapter 3 Structured Program Development in C Part II C How to Program, 8/e, GE 2016 Pearson Education, Ltd. All rights reserved. 1 3.7 The while Iteration Statement An iteration statement (also called

More information

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

Program Development. Chapter 3: Program Statements. Program Statements. Requirements. Java Software Solutions for AP* Computer Science A 2nd Edition Chapter 3: Program Statements Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition Program Development The creation of software involves four basic activities: establishing

More information

ECE 122. Engineering Problem Solving with Java

ECE 122. Engineering Problem Solving with Java ECE 122 Engineering Problem Solving with Java Lecture 10 For Loops and Arrays Outline Problem: How can I perform the same operations a fixed number of times? Considering for loops Performs same operations

More information

Chapter 3: Program Statements

Chapter 3: Program Statements Chapter 3: Program Statements Presentation slides for Java Software Solutions for AP* Computer Science 3rd Edition by John Lewis, William Loftus, and Cara Cocking Java Software Solutions is published by

More information

Control Statements. Musa M. Ameen Computer Engineering Dept.

Control Statements. Musa M. Ameen Computer Engineering Dept. 2 Control Statements Musa M. Ameen Computer Engineering Dept. 1 OBJECTIVES In this chapter you will learn: To use basic problem-solving techniques. To develop algorithms through the process of topdown,

More information

Programming Logic and Design Sixth Edition

Programming Logic and Design Sixth Edition Objectives Programming Logic and Design Sixth Edition Chapter 6 Arrays In this chapter, you will learn about: Arrays and how they occupy computer memory Manipulating an array to replace nested decisions

More information

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

Computer Science 4U Unit 1. Programming Concepts and Skills Algorithms Computer Science 4U Unit 1 Programming Concepts and Skills Algorithms Algorithm In mathematics and computer science, an algorithm is a step-by-step procedure for calculations. Algorithms are used for calculation,

More information

More on control structures

More on control structures Lecture slides for: Chapter 5 More on control structures Java Actually: A Comprehensive Primer in Programming Khalid Azim Mughal, Torill Hamre, Rolf W. Rasmussen Cengage Learning, 2008. ISBN: 978-1-844480-933-2

More information

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

CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING Chapter 4: Repetition Control Structure Learning Objectives At the end of this chapter, student should be able to: Understand the requirement of a loop Understand the Loop Control Variable () Use increment (++) and decrement ( ) operators Program

More information

Software Engineering using Formal Methods

Software Engineering using Formal Methods Software Engineering using Formal Methods Introduction to Promela Wolfgang Ahrendt 03 September 2015 SEFM: Promela /GU 150903 1 / 36 Towards Model Checking System Model Promela Program byte n = 0; active

More information

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

Chapter 5: Control Structures II (Repetition) Objectives (cont d.) Objectives. while Looping (Repetition) Structure. Why Is Repetition Needed? Chapter 5: Control Structures II (Repetition) Objectives In this chapter, you will: Learn about repetition (looping) control structures Explore how to construct and use countercontrolled, sentinel-controlled,

More information

G Programming Languages - Fall 2012

G Programming Languages - Fall 2012 G22.2110-003 Programming Languages - Fall 2012 Lecture 3 Thomas Wies New York University Review Last week Names and Bindings Lifetimes and Allocation Garbage Collection Scope Outline Control Flow Sequencing

More information

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

Chapter 6 Repetition. 6.1 Do Loops 6.2 For...Next Loops 6.3 List Boxes and Loops Chapter 6 Repetition 6.1 Do Loops 6.2 For...Next Loops 6.3 List Boxes and Loops 1 6.1 Do Loops Pretest Form of a Do Loop Posttest Form of a Do Loop 2 Do Loops A loop is one of the most important structures

More information

Problem Solving with C++

Problem Solving with C++ GLOBAL EDITION Problem Solving with C++ NINTH EDITION Walter Savitch Kendrick Mock Ninth Edition PROBLEM SOLVING with C++ Problem Solving with C++, Global Edition Cover Title Copyright Contents Chapter

More information

Lecture 6 Sorting and Searching

Lecture 6 Sorting and Searching Lecture 6 Sorting and Searching Sorting takes an unordered collection and makes it an ordered one. 1 2 3 4 5 6 77 42 35 12 101 5 1 2 3 4 5 6 5 12 35 42 77 101 There are many algorithms for sorting a list

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR 603203 DEPARTMENT OF COMPUTER SCIENCE & APPLICATIONS QUESTION BANK (2017-2018) Course / Branch : M.Sc CST Semester / Year : EVEN / II Subject Name

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

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

Multiple Choice (Questions 1 13) 26 Points Select all correct answers (multiple correct answers are possible) Name Closed notes, book and neighbor. If you have any questions ask them. Notes: Segment of code necessary C++ statements to perform the action described not a complete program Program a complete C++ program

More information

4.1 COMPUTATIONAL THINKING AND PROBLEM-SOLVING

4.1 COMPUTATIONAL THINKING AND PROBLEM-SOLVING 4.1 COMPUTATIONAL THINKING AND PROBLEM-SOLVING 4.1.2 ALGORITHMS ALGORITHM An Algorithm is a procedure or formula for solving a problem. It is a step-by-step set of operations to be performed. It is almost

More information

Programming Fundamentals

Programming Fundamentals Programming Fundamentals Computers are really very dumb machines -- they only do what they are told to do. Most computers perform their operations on a very primitive level. The basic operations of a computer

More information

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

Control Structures. Control Structures Conditional Statements COMPUTER PROGRAMMING. Electrical-Electronics Engineering Dept. EEE-117 COMPUTER PROGRAMMING Control Structures Conditional Statements Today s s Objectives Learn about control structures Examine relational and logical operators Explore how to form and evaluate logical

More information

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

IUSE Knowledge Test. 1. Demographic Questions. IUSE Knowledge Test. 2. Computational Thinking Knowledge Test IUSE Knowledge Test 1. Demographic Questions Your student ID number will be erased from the data file after this survey is linked to the other surveys you have taken or will be taking. * 1. Please enter

More information

Sorting. Introduction. Classification

Sorting. Introduction. Classification Sorting Introduction In many applications it is necessary to order give objects as per an attribute. For example, arranging a list of student information in increasing order of their roll numbers or arranging

More information

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

The for Loop, Accumulator Variables, Seninel Values, and The Random Class. CS0007: Introduction to Computer Programming The for Loop, Accumulator Variables, Seninel Values, and The Random Class CS0007: Introduction to Computer Programming Review General Form of a switch statement: switch (SwitchExpression) { case CaseExpression1:

More information

12 Abstract Data Types

12 Abstract Data Types 12 Abstract Data Types 12.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: Define the concept of an abstract data type (ADT). Define

More information