Similar documents
PLD Semester Exam Study Guide Dec. 2018

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

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

Programming for Engineers Iteration

Chapter 2: Understanding Structure. Programming Logic and Design, 4 th Edition Introductory


Introduction. C provides two styles of flow control:

Chapter 1: Problem Solving Skills Introduction to Programming GENG 200

Lecture 7 Tao Wang 1

Objectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures. Control Structures (cont d.) Relational Operators

Computers Programming Course 6. Iulian Năstac

Chapter 4: Control Structures I (Selection) Objectives. Objectives (cont d.) Control Structures. Control Structures (cont d.

Skill Area 306: Develop and Implement Computer Program

Microsoft Visual Basic 2005: Reloaded

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

Programming Logic and Design Ninth Edition

Chapter 1: An Overview of Computers and Logic

COP 2000 Introduction to Computer Programming Mid-Term Exam Review

Loops! Loops! Loops! Lecture 5 COP 3014 Fall September 25, 2017

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

LECTURE 5 Control Structures Part 2

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

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

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

Programming Logic and Design Seventh Edition

FLOW CHART AND PSEUDO CODE

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

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

Sequence structure. The computer executes java statements one after the other in the order in which they are written. Total = total +grade;

Chapter 4: Control Structures I (Selection)

Simple Java Programming Constructs 4

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

Programming revision. Revision tip: Focus on the things you find difficult first.

REPETITION CONTROL STRUCTURE LOGO

Introduction to Programming Using Java (98-388)

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017

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

A Beginner s Guide to Programming Logic, Introductory

Iteration: Intro. Two types of loops: 1. Pretest Condition precedes body Iterates 0+ times. 2. Posttest Condition follows body Iterates 1+ times

Repetition Structures

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

Chapter 2: Functions and Control Structures

Second Term ( ) Department of Computer Science Foundation Year Program Umm Al Qura University, Makkah

Test #2 October 8, 2015

More Programming Constructs -- Introduction

STUDENT OUTLINE. Lesson 8: Structured Programming, Control Structures, if-else Statements, Pseudocode

Computing Science 114 Solutions to Midterm Examination Tuesday October 19, In Questions 1 20, Circle EXACTLY ONE choice as the best answer

Chapter 4: Basic C Operators

4. Inputting data or messages to a function is called passing data to the function.

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


Chapter 4 C Program Control

Pseudo Code and Flow Charts. Chapter 1 Lesson 2

COP 1220 Introduction to Programming in C++ Course Justification

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

Engineering program development. Edited by Péter Vass

Chapter Goals. Contents LOOPS

Unit 3. Operators. School of Science and Technology INTRODUCTION

Chapter 3 Structured Program Development

Visual Basic 2010 How to Program by Pearson Education, Inc. All Rights Reserved.

Unit 1 Lesson 4. Introduction to Control Statements

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

Control Statements. Musa M. Ameen Computer Engineering Dept.

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

CP FAQS Q-1) Define flowchart and explain Various symbols of flowchart Q-2) Explain basic structure of c language Documentation section :

C++ Programming Lecture 7 Control Structure I (Repetition) Part I

Chapter 7. Expressions and Assignment Statements ISBN

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

o Counter and sentinel controlled loops o Formatting output o Type casting o Top-down, stepwise refinement

Multiple Choice Questions ( 1 mark)

Information Science 1

Self-test Programming Fundamentals

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

Objectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures

Chapter 5 Control Statements: Part 2 Section 5.2 Essentials of Counter-Controlled Repetition

C++ Programming: From Problem Analysis to Program Design, Fourth Edition. Chapter 4: Control Structures I (Selection)

Structured Program Development in C

All copyrights reserved - KV NAD, Aluva. Dinesh Kumar Ram PGT(CS) KV NAD Aluva

Introduction to Flowcharting

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

Expressions & Assignment Statements

PROBLEM SOLVING WITH LOOPS. Chapter 7

A Look Back at Arithmetic Operators: the Increment and Decrement

Chapter 4 Introduction to Control Statements

Course Outline. Introduction to java

Method & Tools for Program Analysis & Design

Fundamentals of Programming Session 9

Java Fundamentals p. 1 The Origins of Java p. 2 How Java Relates to C and C++ p. 3 How Java Relates to C# p. 4 Java's Contribution to the Internet p.

IDENTIFY WAYS OF REPRESENTING ALGORITHMS.

Chapter 4 C Program Control

COMP 202 Recursion. CONTENTS: Recursion. COMP Recursion 1

CSE101-lec#12. Designing Structured Programs Introduction to Functions. Created By: Amanpreet Kaur & Sanjeev Kumar SME (CSE) LPU

Assignment: 1. (Unit-1 Flowchart and Algorithm)

Chapter 5 : Repetition (pp )

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

1 Lexical Considerations

Chapter 4: Control structures. Repetition

IT 1033: Fundamentals of Programming Loops

CS 106 Introduction to Computer Science I

Constants and Variables

Transcription:

Page 1 of 14 Version A Midterm Review 1. The sign means greater than. > = <= < 2. Before a programmer plans the logic of the program, he or she must. understand the problem write the program code test the program maintain the program 3. In a truth table, the expression is false. false OR false true OR true true OR false false OR true 4. If the DogWeight entered is 14, what will be the value printed for DogFee? 125 55 75

Page 2 of 14 105 5. In a structured program, any structure can be nested within another structure. 6. Variable names can be more than one word with blanks between the words. 7. data items may involve organizing or sorting them, checking them for accuracy, or performing calculations with them. Processing Outputting Converting Inputting 8. Both the while loop and the for loop are examples of pretest loops. 9. After programs are put into production, making necessary changes is called. conversion testing debugging maintenance 10. A(n) is any numeric variable you use to count the number of times an event has occurred. index key accumulator counter 11. The is used to represent output in a flowchart. square triangle circle

Page 3 of 14 parallelogram 12. In a selection structure, you perform an action or task, and then you perform the next action in order. 13. Computers process information (output) into data (input). 14. After a programmer plans the logic of a program, the next step is. coding the program testing the program understanding the problem translating the program 15. In a truth table, the expression is true. false AND true false AND false true AND false true AND true 16. A variable s unknown value is commonly called. default garbage initial deterministically random 17. If the DogWeight entered is 31, what will be the value printed for DogFee?

Page 4 of 14 55 105 75 125 18. The repetition of a series of steps is called a(n). infinite loop loop repeat flow flow 19. Most programming languages allow you to ask two or more questions in a single comparison by using a(n) operator that joins decisions in a single statement. IF OR AND XOR 20. If the DogWeight entered is 17, what will be the value printed for DogFee?

Page 5 of 14 105 75 55 125 21. If the DogWeight entered is 82, what will be the value printed for DogFee? 105 75 125 55 22. The assignment operator has left-to-right-to-left associativity, which means that the value of the expression to the left of the assignment operator is evaluated first and that the result is assigned to the operand on the right 23. The following pseudocode is an example of a structure.

Page 6 of 14 get firstnumber get secondnumber add firstnumber and secondnumber print result nested loop decision sequence 24. The process of naming program variables and assigning a type to them is called variables. proclaiming declaring initializing identifying 25. Any decision can be made using combinations of just two types of comparisons: equal and not equal. 26. Many loop control variable values are altered by, or adding to them. deprecating decrementing incrementing accumulating 27. The electronic components and circuitry of the system unit, such as the processor and memory, usually are part of or are connected to a circuit board called the fatherboard. 28. Fill in the blank in the following pseudocode: if somecondition is true then...do oneprocess...do theotherprocess then do while else

Page 7 of 14 29. A(n) decision is a decision in which two conditions must be true for an action to take place. XOR OR AND OR-ELSE 30. You represent a decision in a flowchart by drawing a decision symbol, which is shaped like a. parallelogram square diamond circle 31. You can use parentheses to override the default order of operations. 32. In most programming languages, before you can use any variable, you must include a for it. declaration proclamation header definition 33. When you combine AND and OR operators, the OR operators take precedence, meaning their Boolean values are evaluated first. 34. You can either increment or decrement the loop control variable. 35. An infinite loop is a flow of program logic that repeats and never ends.

Page 8 of 14 36. The following pseudocode is an example of a structure. if firstnumber is bigger than secondnumber then...print firstnumber else...print secondnumber sequence loop decision nested 37. errors are relatively easy to locate and correct because the compiler or interpreter you use highlights every error. Input Logic Syntax Process 38. A string variable can hold digits such as phone numbers and zip codes. 39. Besides AND and OR operators, most languages support a NOT operator. 40. The loop control variable is initialized after entering the loop. 41. The first step in a while loop is typically to. compare the loop control variable to a constant value execute the body of the loop increment the loop control variable initialize the loop control variable 42. In many programming languages, if you declare a variable and do not initialize it, the variable contains an unknown value until it is assigned a value.

Page 9 of 14 43. Declaring a starting value for a variable is known as the variable. defining declaring identifying initializing 44. The assignment operator is the sign. / * + = 45. Structured programs use spaghetti code logic. 46. A(n) is a named memory location whose value can vary. logic variable output input 47. With a(n), you perform an action or task, and then you perform the next action, in order. sequence problem ordered structure sequence structure loop sequence 48. A(n) decision is a decision in which at least one of two conditions must be true for an action to take place. nested AND NOT OR 49. Usually, variables are not considered to be equal unless they are identical. character

Page 10 of 14 integer floating point string 50. Placing a structure within another structure is called structures. stacking selecting shelling nesting 51. A variable can hold more than one value at any given moment in time. 52. You may hear programmers refer to looping as. case execution selection iteration 53. Typically, a programmer develops a program s logic, writes the code, and the program, receiving a list of syntax errors. tests compiles runs executes 54. A structured program must contain a sequence, selection, and loop structure. 55. In a flowchart, the is used to represent processing. circle triangle diamond rectangle 56. The process of finding and correcting program errors is called.

Page 11 of 14 syntax-checking desk-checking error correcting debugging 57. The following pseudocode is an example of a structure. get number while number is positive...add to sum...get number nested loop decision sequence 58. If the DogWeight entered is 80, what will be the value printed for DogFee? 55 105 125 75 59. Programs that use code logic are unstructured programs that do not follow the rules of structured logic. spaghetti case nested loop 60. A structured program includes only combinations of the three basic structures:.

Page 12 of 14 sequence, iteration, and loop iteration, selection, and loop identification, selection, and loop sequence, selection, and loop

Page 13 of 14 Version A Answer Sheet Midterm Review 1. > 2. understand the problem 3. false OR false 4. 55 5. 6. 7. Processing 8. 9. maintenance 10. counter 11. parallelogram 12. 13. 14. coding the program 15. true AND true 16. garbage 17. 105 18. loop 19. AND 20. 75 21. 125 22. 23. sequence 24. declaring 25. 26. incrementing 27. 28. else 29. AND 30. diamond 31.

Page 14 of 14 32. declaration 33. 34. 35. 36. decision 37. Syntax 38. 39. 40. 41. initialize the loop control variable 42. 43. initializing 44. = 45. 46. variable 47. sequence structure 48. OR 49. string 50. nesting 51. 52. iteration 53. compiles 54. 55. rectangle 56. debugging 57. loop 58. 105 59. spaghetti 60. sequence, selection, and loop