PYTHON PROGRAMMING. John M.Zelle. Wartburg College AN INTRODUCTION TO COMPUTER SCIENCE SECOND EDITION

Size: px
Start display at page:

Download "PYTHON PROGRAMMING. John M.Zelle. Wartburg College AN INTRODUCTION TO COMPUTER SCIENCE SECOND EDITION"

Transcription

1 PYTHON PROGRAMMING AN INTRODUCTION TO COMPUTER SCIENCE SECOND EDITION * John M.Zelle Wartburg College Franklin, Beedle & Associates Inc. * SW Washington Si 'efion * 503/

2 Contents Foreword, by Guido van Rossum ix Preface, x Chapter 1 Computers and Programs The Universal Machine Program Power What is Computer Science? Hardware Basics Programming Languages The Magic of Python Inside a Python Program Chaos and Computers Chapter Summary Exercises 21 Chapter 2 Writing Simple Programs The Software Development Process Example Program: Temperature Converter Elements of Programs Names Expressions Output Statements Assignment Statements Simple Assignment Assigning Input Simultaneous Assignment Definite Loops Example Program: Future Value 46

3 iv Contents 2.8 Chapter Summary Exercises 51 Chapter 3 Computing with Numbers Numeric Data Types Using the Math Library Accumulating Results: Factorial Limitations of Computer Arithmetic Type Conversions and Rounding Chapter Summary Exercises 72 Chapter 4 Objects and Graphics Overview The Object of Objects Simple Graphics Programming Using Graphical Objects Graphing Future Value Choosing Coordinates Interactive Graphics Getting Mouse Clicks Handling Textual Input Graphics Module Reference GraphWin Objects Graphics Objects Entry Objects Ill Displaying Images Generating Colors Controlling Display Updates (Advanced) Chapter Summary Exercises 115 Chapter 5 Sequences: Strings, Lists, and Files The String Data Type Simple String Processing Lists as Sequences String Representation and Message Encoding String Representation Programming an Encoder String Methods Programming a Decoder More String Methods Lists Have Methods Too From Encoding to Encryption Input/Output as String Manipulation Example Application: Date Conversion 143

4 Contents v String Formatting Better Change Counter File Processing Multi-Line Strings File Processing Example Program: Batch Usernames Chapter Summary Exercises 159 Chapter 6 Defining Functions The Function of Functions Functions, Informally Future Value with a Function Functions and Parameters: The Exciting Details Getting Results from a Function Functions That Return Values Functions That Modify Parameters Functions and Program Structure Chapter Summary Exercises 194 Chapter 7 Decision Structures Simple Decisions Example: Temperature Warnings Forming Simple Conditions Example: Conditional Program Execution Two-Way Decisions Multi-Way Decisions Exception Handling Study in Design: Max of Three Strategy 1: Compare Each to All Strategy 2: Decision Tree Strategy 3: Sequential Processing Strategy 4: Use Python Some Lessons Chapter Summary Exercises 227 Chapter 8 Loop Structures and Booleans For Loops: A Quick Review Indefinite Loops Common Loop Patterns Interactive Loops Sentinel Loops File Loops Nested Loops 244

5 vi Contents 8.4 Computing with Booleans Boolean Operators Boolean Algebra Other Common Structures Post-Test Loop Loop and a Half Boolean Expressions as Decisions Chapter Summary Exercises 260 Chapter 9 Simulation and Design Simulating Racquetball A Simulation Problem Analysis and Specification Pseudo Random Numbers Top-Down Design Top-Level Design Separation of Concerns Second-Level Design Designing simngames Third-Level Design Finishing Up Summary of the Design Process Bottom-Up Implementation Unit Testing Simulation Results Other Design Techniques Prototyping and Spiral Development The Art of Design Chapter Summary Exercises 291 Chapter 10 Defining Classes Quick Review of Objects Example Program: Cannonball Program Specification Designing the Program Modularizing the Program Defining New Classes Example: Multi-Sided Dice Example: The Projectile Class Data Processing with Class Objects and Encapsulation Encapsulating Useful Abstractions Putting Classes in Modules Module Documentation 317

6 Contents vii Working with Multiple Modules Widgets Example Program: Dice Roller Building Buttons Building Dice The Main Program Chapter Summary Exercises 331 Chapter 11 Data Collections Example Problem: Simple Statistics Applying Lists Lists and Arrays List Operations Statistics with Lists Lists of Records Designing with Lists and Classes Case Study: Python Calculator A Calculator as an Object Constructing the Interface Processing Buttons Non-Sequential Collections Dictionary Basics Dictionary Operations Example Program: Word Frequency Chapter Summary Exercises 378 Chapter 12 Object-Oriented Design The Process of OOD Case Study: Racquetball Simulation Candidate Objects and Methods Implementing SimStats Implementing RBallGame Implementing Player The Complete Program Case Study: Dice Poker Program Specification Identifying Candidate Objects Implementing the Model A Text-Based Ul Developing a GUI OO Concepts Encapsulation Polymorphism Inheritance 419

7 viii Contents 12.5 Chapter Summary Exercises 421 Chapter 13 Algorithm Design and Recursion Searching A Simple Searching Problem Strategy 1: Linear Search Strategy 2: Binary Search Comparing Algorithms Recursive Problem-Solving Recursive Definitions Recursive Functions Example: String Reversal Example: Anagrams Example: Fast Exponentiation Example: Binary Search Recursion vs. Iteration Sorting Algorithms Naive Sorting: Selection Sort Divide and Conquer: Merge Sort Comparing Sorts Hard Problems Towers of Hanoi The Halting Problem Conclusion Chapter Summary Exercises 460 Appendix A Python Quick Reference 469 Appendix B Using Python and IDLE 479 Appendix C Glossary 491 Index 503

[CHAPTER] 1 INTRODUCTION 1

[CHAPTER] 1 INTRODUCTION 1 FM_TOC C7817 47493 1/28/11 9:29 AM Page iii Table of Contents [CHAPTER] 1 INTRODUCTION 1 1.1 Two Fundamental Ideas of Computer Science: Algorithms and Information Processing...2 1.1.1 Algorithms...2 1.1.2

More information

Python Programming: An Introduction to Computer Science. John M. Zelle, Ph.D.

Python Programming: An Introduction to Computer Science. John M. Zelle, Ph.D. Python Programming: An Introduction to Computer Science John M. Zelle, Ph.D. Version 1.0rc2 Fall 2002 Copyright c 2002 by John M. Zelle All rights reserved. No part of this publication may be reproduced,

More information

Part I Basic Concepts 1

Part I Basic Concepts 1 Introduction xiii Part I Basic Concepts 1 Chapter 1 Integer Arithmetic 3 1.1 Example Program 3 1.2 Computer Program 4 1.3 Documentation 5 1.4 Input 6 1.5 Assignment Statement 7 1.5.1 Basics of assignment

More information

Introduction... ix. Chapter 1: Exploring Fundamental Programming Concepts... 1

Introduction... ix. Chapter 1: Exploring Fundamental Programming Concepts... 1 Table of Contents Introduction... ix Chapter 1: Exploring Fundamental Programming Concepts... 1 1.1 Exploring the Editors... 2 History of Editors... 2 Exploring the Types of Text Editors... 3 Describing

More information

SAMPLE CURRICULUM GUIDE June 2014

SAMPLE CURRICULUM GUIDE June 2014 SAMPLE CURRICULUM GUIDE June 2014 A Level Computer Science A LEVEL REFORM CONTENTS Introduction Page 3 Year 1 Page 4 Year 2 Page 8 This resource is an exemplar of the types of materials that will be provided

More information

GE PROBLEM SOVING AND PYTHON PROGRAMMING. Question Bank UNIT 1 - ALGORITHMIC PROBLEM SOLVING

GE PROBLEM SOVING AND PYTHON PROGRAMMING. Question Bank UNIT 1 - ALGORITHMIC PROBLEM SOLVING GE8151 - PROBLEM SOVING AND PYTHON PROGRAMMING Question Bank UNIT 1 - ALGORITHMIC PROBLEM SOLVING 1) Define Computer 2) Define algorithm 3) What are the two phases in algorithmic problem solving? 4) Why

More information

Computer Organization

Computer Organization A Text Book of Computer Organization and Architecture Prof. JATINDER SINGH Director, GGI, Dhaliwal Er. AMARDEEP SINGH M.Tech (IT) AP&HOD, Deptt.of CSE, SVIET, Banur Er. GURJEET SINGH M.Tech (CSE) Head,

More information

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17 List of Programs xxv List of Figures xxix List of Tables xxxiii Preface to second version xxxv PART 1 Structured Programming 1 1 Getting started 3 1.1 Programming 3 1.2 Editing source code 5 Source code

More information

Contents Chapter 1 Introduction to Programming and the Java Language

Contents Chapter 1 Introduction to Programming and the Java Language Chapter 1 Introduction to Programming and the Java Language 1.1 Basic Computer Concepts 5 1.1.1 Hardware 5 1.1.2 Operating Systems 8 1.1.3 Application Software 9 1.1.4 Computer Networks and the Internet

More information

JAVA CONCEPTS Early Objects

JAVA CONCEPTS Early Objects INTERNATIONAL STUDENT VERSION JAVA CONCEPTS Early Objects Seventh Edition CAY HORSTMANN San Jose State University Wiley CONTENTS PREFACE v chapter i INTRODUCTION 1 1.1 Computer Programs 2 1.2 The Anatomy

More information

This page intentionally left blank

This page intentionally left blank This page intentionally left blank arting Out with Java: From Control Structures through Objects International Edition - PDF - PDF - PDF Cover Contents Preface Chapter 1 Introduction to Computers and Java

More information

CLASSIC DATA STRUCTURES IN JAVA

CLASSIC DATA STRUCTURES IN JAVA CLASSIC DATA STRUCTURES IN JAVA Timothy Budd Oregon State University Boston San Francisco New York London Toronto Sydney Tokyo Singapore Madrid Mexico City Munich Paris Cape Town Hong Kong Montreal CONTENTS

More information

MyProgram m i ng Lab. get with the programming. Through the power of practice and immediate personalized

MyProgram m i ng Lab. get with the programming. Through the power of practice and immediate personalized get with the programming Through the power of practice and immediate personalized feedback, MyProgrammingLab improves your performance. MyProgram m i ng Lab Learn more at www.myprogramminglab.com Preface

More information

Building Java Programs

Building Java Programs Building Java Programs A Back to Basics Approach Stuart Reges I Marty Stepp University ofwashington Preface 3 Chapter 1 Introduction to Java Programming 25 1.1 Basic Computing Concepts 26 Why Programming?

More information

Welcome to Starting Out with Programming Logic and Design, Third Edition.

Welcome to Starting Out with Programming Logic and Design, Third Edition. Welcome to Starting Out with Programming Logic and Design, Third Edition. This book uses a language-independent approach to teach programming concepts and problem-solving skills, without assuming any previous

More information

Programming in Python 3

Programming in Python 3 Programming in Python 3 A Complete Introduction to the Python Language Mark Summerfield.4.Addison-Wesley Upper Saddle River, NJ Boston Indianapolis San Francisco New York Toronto Montreal London Munich

More information

Contents. Introduction

Contents. Introduction Contents Preface Introduction xiii xvii 1 Why Did the Chicken Cross the Road? 1 1.1 The Computer.......................... 1 1.2 Turing Machine.......................... 3 CT: Abstract Away......................

More information

Introduction p. 1 Pseudocode p. 2 Algorithm Header p. 2 Purpose, Conditions, and Return p. 3 Statement Numbers p. 4 Variables p. 4 Algorithm Analysis

Introduction p. 1 Pseudocode p. 2 Algorithm Header p. 2 Purpose, Conditions, and Return p. 3 Statement Numbers p. 4 Variables p. 4 Algorithm Analysis Introduction p. 1 Pseudocode p. 2 Algorithm Header p. 2 Purpose, Conditions, and Return p. 3 Statement Numbers p. 4 Variables p. 4 Algorithm Analysis p. 5 Statement Constructs p. 5 Pseudocode Example p.

More information

ощ 'ршорвшэш! цвн-эориэу ощ 'sajbpossv # PIPG DUJ 'ssjmoossv ^ PIPG pipa w н OX ЛЮН VAV

ощ 'ршорвшэш! цвн-эориэу ощ 'sajbpossv # PIPG DUJ 'ssjmoossv ^ PIPG pipa w н OX ЛЮН VAV ощ 'ршорвшэш! цвн-эориэу ощ 'sajbpossv # PIPG DUJ 'ssjmoossv ^ PIPG pipa w н OX ЛЮН VAV Contents Preface Chapter 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19

More information

WITH C+ + William Ford University of the Pacific. William Topp University of the Pacific. Prentice Hall, Englewood Cliffs, New Jersey 07632

WITH C+ + William Ford University of the Pacific. William Topp University of the Pacific. Prentice Hall, Englewood Cliffs, New Jersey 07632 DATA STRUCTURES WITH C+ + William Ford University of the Pacific William Topp University of the Pacific Prentice Hall, Englewood Cliffs, New Jersey 07632 CONTENTS Preface xvii CHAPTER 1 INTRODUCTION 1

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

ENGINEERING PROBLEM SOLVING WITH C++

ENGINEERING PROBLEM SOLVING WITH C++ ENGINEERING PROBLEM SOLVING WITH C++ Second Edition Delores M. Etter Electrical Engineering Department United States Naval Academy Jeanine A. Ingber Training Consultant Sandia National Laboratories Upper

More information

Object-oriented design

Object-oriented design Object-oriented design Michael Mandel Lecture 11 Methods in Computational Linguistics I The City University of New York, Graduate Center https://github.com/ling78100/lectureexamples/blob/master/lecture11final.ipynb

More information

About the Authors. Preface

About the Authors. Preface Contents About the Authors Acknowledgments Preface iv v xv 1: Introduction to Programming and RPG 1 1.1. Chapter Overview 1 1.2. Programming 1 1.3. History of RPG 2 1.4. Program Variables 6 1.5. Libraries,

More information

Course materials Reges, Stuart, and Stepp, Martin. Building Java Programs: A Back to Basics Approach. 2d ed. (Boston: Addison-Wesley, 2011).

Course materials Reges, Stuart, and Stepp, Martin. Building Java Programs: A Back to Basics Approach. 2d ed. (Boston: Addison-Wesley, 2011). AP Computer Science A Advanced Placement Computer Science A is a fast-paced course equivalent to a college introductory programming class. Students will learn about the exciting kinds of problems tackled

More information

OCR Level 3 Advanced GCE in Computer Science (H446)

OCR Level 3 Advanced GCE in Computer Science (H446) OCR Level 3 Advanced GCE in Computer Science (H446) At its heart lies the notion of computational thinking: a mode of thought that goes well beyond software and hardware, and that provides a framework

More information

Object-Oriented Programming and Data Structures

Object-Oriented Programming and Data Structures Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin Phillips Academy, Andover, Massachusetts Gary Litvin Skylight Software, Inc. Skylight Publishing Andover, Massachusetts

More information

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++ Introduction to Programming in C++ Course Text Programming in C++, Zyante, Fall 2013 edition. Course book provided along with the course. Course Description This course introduces programming in C++ and

More information

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object CHAPTER 1 Introduction to Computers and Programming 1 1.1 Why Program? 1 1.2 Computer Systems: Hardware and Software 2 1.3 Programs and Programming Languages 8 1.4 What is a Program Made of? 14 1.5 Input,

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

Prelude to Programming

Prelude to Programming GLOBAL EDITION Prelude to Programming Concepts and Design SIXTH EDITION Stewart Venit Elizabeth Drake Prelude toprogramming Sixth Edition Global Edition Concepts and Design Stewart Venit Elizabeth Drake

More information

Big Java Late Objects

Big Java Late Objects Big Java Late Objects Horstmann, Cay S. ISBN-13: 9781118087886 Table of Contents 1. Introduction 1.1 Computer Programs 1.2 The Anatomy of a Computer 1.3 The Java Programming Language 1.4 Becoming Familiar

More information

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

IMACS: AP Computer Science A

IMACS: AP Computer Science A IMACS: AP Computer Science A OVERVIEW This course is a 34-week, 4 classroom hours per week course for students taking the College Board s Advanced Placement Computer Science A exam. It is an online course

More information

Data Structures in C++ Using the Standard Template Library

Data Structures in C++ Using the Standard Template Library Data Structures in C++ Using the Standard Template Library Timothy Budd Oregon State University ^ ADDISON-WESLEY An imprint of Addison Wesley Longman, Inc. Reading, Massachusetts Harlow, England Menlo

More information

M.Sc. (Computer Science) I Year Assignments for May Paper I DATA STRUCTURES Assignment I

M.Sc. (Computer Science) I Year Assignments for May Paper I DATA STRUCTURES Assignment I Paper I DATA STRUCTURES (DMCS 01) 1. Explain in detail about the overview of Data structures. 2. Explain circular linked list and double-linked list. 3. Explain CPU scheduling in Multiprogramming Environment.

More information

Java Software Solutions for AP Computer Science 3rd Edition, Lewis et al. 2011

Java Software Solutions for AP Computer Science 3rd Edition, Lewis et al. 2011 A Correlation of AP Computer Science 3rd Edition, Lewis et al. 2011 To the INTRODUCTION This document demonstrates how AP (Advanced Placement) Computer Science, 3rd Edition 2011, Lewis et al. meets the

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

Introduction to Computer Science with Python Course Syllabus

Introduction to Computer Science with Python Course Syllabus CodeHS Introduction to Computer Science with Python Course Syllabus Course Overview and Goals The CodeHS Introduction to Computer Science in Python course teaches the fundamentals of computer programming

More information

Python review. 1 Python basics. References. CS 234 Naomi Nishimura

Python review. 1 Python basics. References. CS 234 Naomi Nishimura Python review CS 234 Naomi Nishimura The sections below indicate Python material, the degree to which it will be used in the course, and various resources you can use to review the material. You are not

More information

COP 1170 Introduction to Computer Programming using Visual Basic

COP 1170 Introduction to Computer Programming using Visual Basic Course Justification This course is the first computer programming course in the Computer Information Systems Associate in Arts degree program; is required in the Computer Programming and Analysis, Database

More information

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS Contents Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS 1.1. INTRODUCTION TO COMPUTERS... 1 1.2. HISTORY OF C & C++... 3 1.3. DESIGN, DEVELOPMENT AND EXECUTION OF A PROGRAM... 3 1.4 TESTING OF PROGRAMS...

More information

Year 12 Computer Science Learning Cycle 2 Overview

Year 12 Computer Science Learning Cycle 2 Overview Year 12 Computer Science Learning Cycle 2 Overview Learning Cycle Overview: Specification Topic Taught Week 1.2.1 abcd Operating System Functions, MM, Interupts & Scheduling 2.2.1 ea Integrated Development

More information

102. Introduction to Java Programming

102. Introduction to Java Programming 102. Introduction to Java Programming Version 5.0 Java is a popular and powerful language. Although comparatively simple in its language structure, there are a number of subtleties that can trip up less

More information

Standard. Number of Correlations

Standard. Number of Correlations Computer Science 2016 This assessment contains 80 items, but only 80 are used at one time. Programming and Software Development Number of Correlations Standard Type Standard 2 Duty 1) CONTENT STANDARD

More information

PROBLEM SOLVING WITH FORTRAN 90

PROBLEM SOLVING WITH FORTRAN 90 David R. Brooks PROBLEM SOLVING WITH FORTRAN 90 FOR SCIENTISTS AND ENGINEERS Springer Contents Preface v 1.1 Overview for Instructors v 1.1.1 The Case for Fortran 90 vi 1.1.2 Structure of the Text vii

More information

Course: AP Computer Science A Description and Syllabus Description of Course:

Course: AP Computer Science A Description and Syllabus Description of Course: Page 1 Course: AP Computer Science A 2007-2008 Description and Syllabus Description of Course: AP Computer Science A is designed to: Train students in programming methodology to produce quality computer-based

More information

2c. Content of Computer systems (Component 01)

2c. Content of Computer systems (Component 01) c. Content of Computer systems (Component 01) This component will introduce learners to the internal workings of the Central Processing Unit (CPU), the exchange of data and will also look at software development,

More information

3D Graphics Programming Mira Costa High School - Class Syllabus,

3D Graphics Programming Mira Costa High School - Class Syllabus, 3D Graphics Programming Mira Costa High School - Class Syllabus, 2009-2010 INSTRUCTOR: Mr. M. Williams COURSE GOALS and OBJECTIVES: 1 Learn the fundamentals of the Java language including data types and

More information

Lecture Object-Oriented Design. Richard E Sarkis CSC 161: The Art of Programming

Lecture Object-Oriented Design. Richard E Sarkis CSC 161: The Art of Programming Lecture Object-Oriented Design Richard E Sarkis CSC 161: The Art of Programming Class Administrivia Objectives To understand the process of object-oriented design To be able to read and understand object-oriented

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 60 20 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK B.E I SEMESTER GE85- Problem Solving and Python Programming Regulation 207 Academic

More information

Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department

Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department 0901212 Python Programming 1 st Semester 2014/2015 Course Catalog This course introduces

More information

Week. Lecture Topic day (including assignment/test) 1 st 1 st Introduction to Module 1 st. Practical

Week. Lecture Topic day (including assignment/test) 1 st 1 st Introduction to Module 1 st. Practical Name of faculty: Gaurav Gambhir Discipline: Computer Science Semester: 6 th Subject: CSE 304 N - Essentials of Information Technology Lesson Plan Duration: 15 Weeks (from January, 2018 to April, 2018)

More information

Table of Contents. Chapter 1: Introduction to Data Structures... 1

Table of Contents. Chapter 1: Introduction to Data Structures... 1 Table of Contents Chapter 1: Introduction to Data Structures... 1 1.1 Data Types in C++... 2 Integer Types... 2 Character Types... 3 Floating-point Types... 3 Variables Names... 4 1.2 Arrays... 4 Extraction

More information

DISCRETE MATHEMATICS

DISCRETE MATHEMATICS DISCRETE MATHEMATICS WITH APPLICATIONS THIRD EDITION SUSANNA S. EPP DePaul University THOIVISON * BROOKS/COLE Australia Canada Mexico Singapore Spain United Kingdom United States CONTENTS Chapter 1 The

More information

Honorary Professor Supercomputer Education and Research Centre Indian Institute of Science, Bangalore

Honorary Professor Supercomputer Education and Research Centre Indian Institute of Science, Bangalore COMPUTER ORGANIZATION AND ARCHITECTURE V. Rajaraman Honorary Professor Supercomputer Education and Research Centre Indian Institute of Science, Bangalore T. Radhakrishnan Professor of Computer Science

More information

Announcements. Project 5 is on the street. Second part is essay questions for CoS teaming requirements.

Announcements. Project 5 is on the street. Second part is essay questions for CoS teaming requirements. Announcements Project 5 is on the street. Second part is essay questions for CoS teaming requirements. The first part you do as a team The CoS essay gets individually answered and has separate submission

More information

Outline. Simple Recursive Examples Analyzing Recursion Sorting The Tower of Hanoi Divide-and-conquer Approach In-Class Work. 1 Chapter 6: Recursion

Outline. Simple Recursive Examples Analyzing Recursion Sorting The Tower of Hanoi Divide-and-conquer Approach In-Class Work. 1 Chapter 6: Recursion Outline 1 A Function Can Call Itself A recursive definition of a function is one which makes a function call to the function being defined. The function call is then a recursive function call. A definition

More information

Preface to the Second Edition... xi A Note About Source Entry... xi

Preface to the Second Edition... xi A Note About Source Entry... xi Contents Preface to the Second Edition... xi A Note About Source Entry... xi Chapter 1: Pre Free-Format RPG IV... 1 RPG IV... 1 Extended Factor 2... 2 Built-in Functions... 2 Subprocedures... 3 Other Changes...

More information

Instructors: Daniel Deutch, Amir Rubinstein, Teaching Assistants: Amir Gilad, Michal Kleinbort

Instructors: Daniel Deutch, Amir Rubinstein, Teaching Assistants: Amir Gilad, Michal Kleinbort Extended Introduction to Computer Science CS1001.py Lecture 10b: Recursion and Recursive Functions Instructors: Daniel Deutch, Amir Rubinstein, Teaching Assistants: Amir Gilad, Michal Kleinbort School

More information

Data Science with Python Course Catalog

Data Science with Python Course Catalog Enhance Your Contribution to the Business, Earn Industry-recognized Accreditations, and Develop Skills that Help You Advance in Your Career March 2018 www.iotintercon.com Table of Contents Syllabus Overview

More information

Part III Appendices 165

Part III Appendices 165 Part III Appendices 165 Appendix A Technical Instructions Learning Outcomes This material will help you learn how to use the software you need to do your work in this course. You won t be tested on it.

More information

Lecture 19. Topics: Chapter 9. Simulation and Design Moving to graphics library Unit Testing 9.5 Other Design Techniques

Lecture 19. Topics: Chapter 9. Simulation and Design Moving to graphics library Unit Testing 9.5 Other Design Techniques Lecture 19 Topics: Chapter 9. Simulation and Design Moving to graphics library 9.4.1 Unit Testing 9.5 Other Design Techniques 1 9.4.1 Unit Testing When we finish writing a function (a component of a program)

More information

Loop structures and booleans

Loop structures and booleans Loop structures and booleans Michael Mandel Lecture 7 Methods in Computational Linguistics I The City University of New York, Graduate Center https://github.com/ling78100/lectureexamples/blob/master/lecture07final.ipynb

More information

Personalised Learning Checklist ( ) SOUND

Personalised Learning Checklist ( ) SOUND Personalised Learning Checklist (2015-2016) Subject: Computing Level: A2 Name: Outlined below are the topics you have studied for this course. Inside each topic area you will find a breakdown of the topic

More information

1 OBJECT-ORIENTED PROGRAMMING 1

1 OBJECT-ORIENTED PROGRAMMING 1 PREFACE xvii 1 OBJECT-ORIENTED PROGRAMMING 1 1.1 Object-Oriented and Procedural Programming 2 Top-Down Design and Procedural Programming, 3 Problems with Top-Down Design, 3 Classes and Objects, 4 Fields

More information

SCHEME OF EXAMINATION FOR B.Sc.(COMPUTER SCIENCE) SEMESTER SYSTEM (Regular Course) w.e.f Scheme for B.Sc.-I. Semester-I. Internal Assessment

SCHEME OF EXAMINATION FOR B.Sc.(COMPUTER SCIENCE) SEMESTER SYSTEM (Regular Course) w.e.f Scheme for B.Sc.-I. Semester-I. Internal Assessment SCHEME OF EXAMINATION FOR B.Sc.(COMPUTER SCIENCE) SEMESTER SYSTEM (Regular Course) w.e.f. 2013-14 Scheme for B.Sc.-I Sr. No. Paper 1 Paper-I Computer And Programming Fundamentals Semester-I Internal Assessment

More information

Recursive Methods and Problem Solving. Chris Kiekintveld CS 2401 (Fall 2010) Elementary Data Structures and Algorithms

Recursive Methods and Problem Solving. Chris Kiekintveld CS 2401 (Fall 2010) Elementary Data Structures and Algorithms Recursive Methods and Problem Solving Chris Kiekintveld CS 2401 (Fall 2010) Elementary Data Structures and Algorithms Review: Calling Methods int x(int n) { int m = 0; n = n + m + 1; return n; int y(int

More information

AP Computer Science in Java Course Syllabus

AP Computer Science in Java Course Syllabus CodeHS AP Computer Science in Java Course Syllabus College Board Curriculum Requirements The CodeHS AP Java course is fully College Board aligned and covers all seven curriculum requirements extensively

More information

Bloss, Adrienne and N. Jane Ingram. Lab Manual to Accompany Java Software Solutions. New York, New York: Pearson Education, Inc, 2003.

Bloss, Adrienne and N. Jane Ingram. Lab Manual to Accompany Java Software Solutions. New York, New York: Pearson Education, Inc, 2003. Course Overview AP Computer Science A emphasizes a study in object-oriented programming methodologies with a focus on problem solving and algorithm development. Data structures, design, and abstraction

More information

Contents. 1 Introduction. 2 Searching and Traversal Techniques. Preface... (vii) Acknowledgements... (ix)

Contents. 1 Introduction. 2 Searching and Traversal Techniques. Preface... (vii) Acknowledgements... (ix) Contents Preface... (vii) Acknowledgements... (ix) 1 Introduction 1.1 Algorithm 1 1.2 Life Cycle of Design and Analysis of Algorithm 2 1.3 Pseudo-Code for Expressing Algorithms 5 1.4 Recursive Algorithms

More information

R13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC)

R13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC) SET - 1 II B. Tech I Semester Supplementary Examinations, May/June - 2016 PART A 1. a) Write a procedure for the Tower of Hanoi problem? b) What you mean by enqueue and dequeue operations in a queue? c)

More information

1 Chapter Plan...1 Exercise - Simple Program...2

1 Chapter Plan...1 Exercise - Simple Program...2 Chapter 1: Introduction Exercise - Simple Program...2 2 Subject Matter...4 1. What is PL/1?...4 2. PL/1: Strengths and Advantages...5 3. Program Structure...6 4. Data Types...7 5. Built-in Functions...8

More information

Ryan Stephens. Ron Plew Arie D. Jones. Sams Teach Yourself FIFTH EDITION. 800 East 96th Street, Indianapolis, Indiana, 46240

Ryan Stephens. Ron Plew Arie D. Jones. Sams Teach Yourself FIFTH EDITION. 800 East 96th Street, Indianapolis, Indiana, 46240 Ryan Stephens Ron Plew Arie D. Jones Sams Teach Yourself FIFTH EDITION 800 East 96th Street, Indianapolis, Indiana, 46240 Table of Contents Part I: An SQL Concepts Overview HOUR 1: Welcome to the World

More information

Test Bank Ver. 5.0: Data Abstraction and Problem Solving with C++: Walls and Mirrors, 5 th edition, Frank M. Carrano

Test Bank Ver. 5.0: Data Abstraction and Problem Solving with C++: Walls and Mirrors, 5 th edition, Frank M. Carrano Chapter 2 Recursion: The Mirrors Multiple Choice Questions 1. In a recursive solution, the terminates the recursive processing. a) local environment b) pivot item c) base case d) recurrence relation 2.

More information

Sr. No. Subject. 1 Paper I- Theory Computer Component Unit-I- Computer Organization & Architecture Unit-II- Software Engg Unit-III-O.S.

Sr. No. Subject. 1 Paper I- Theory Computer Component Unit-I- Computer Organization & Architecture Unit-II- Software Engg Unit-III-O.S. Shivaji University (Faculty of Commerce) Implemented from Academic year 2013-14 Bridge Course: - The bridge course for the direct MCA II year admitted Candidates Sr. No. Subject Theory Marks Practical

More information

Programme Outcome COURSE OUTCOMES MCA

Programme Outcome COURSE OUTCOMES MCA Programme Outcome PO1: To provide trained human resource for the IT industry. COURSE OUTCOMES MCA MCA 101 : Object Oriented Programming CO1 The students develops a sound approach to problem solving using

More information

Mathematics/Science Department Kirkwood Community College. Course Syllabus. Computer Science CSC142 1/10

Mathematics/Science Department Kirkwood Community College. Course Syllabus. Computer Science CSC142 1/10 Mathematics/Science Department Kirkwood Community College Course Syllabus Computer Science CSC142 Bob Driggs Dean Cate Sheller Instructor 1/10 Computer Science (CSC142) Course Description Introduces computer

More information

C Programming for Electronic Engineers

C Programming for Electronic Engineers C Programming for Electronic Engineers Keith Jackson BSc CEng MIEE with acknowledgement to Gavin Eamshaw MEng School of Electronic, Communication and Electrical Engineering University of Plymouth MACMILLAN

More information

MATHEMATICAL STRUCTURES FOR COMPUTER SCIENCE

MATHEMATICAL STRUCTURES FOR COMPUTER SCIENCE MATHEMATICAL STRUCTURES FOR COMPUTER SCIENCE A Modern Approach to Discrete Mathematics SIXTH EDITION Judith L. Gersting University of Hawaii at Hilo W. H. Freeman and Company New York Preface Note to the

More information

CSI33 Data Structures

CSI33 Data Structures Outline Department of Mathematics and Computer Science Bronx Community College October 10, 2018 Outline Outline 1 Chapter 6: Recursion Outline Chapter 6: Recursion 1 Chapter 6: Recursion Chapter 6: Recursion

More information

CompuScholar, Inc. Alignment to Nevada "Computer Science" Course Standards

CompuScholar, Inc. Alignment to Nevada Computer Science Course Standards CompuScholar, Inc. Alignment to Nevada "Computer Science" Course Standards Nevada Course Details: Course Name: Computer Science Primary Cluster: Information and Media Technologies Standards Course Code(s):

More information

Murach s Beginning Java with Eclipse

Murach s Beginning Java with Eclipse Murach s Beginning Java with Eclipse Introduction xv Section 1 Get started right Chapter 1 An introduction to Java programming 3 Chapter 2 How to start writing Java code 33 Chapter 3 How to use classes

More information

Contents. Preface. Introduction. Introduction to C Programming

Contents. Preface. Introduction. Introduction to C Programming c11fptoc.fm Page vii Saturday, March 23, 2013 4:15 PM Preface xv 1 Introduction 1 1.1 1.2 1.3 1.4 1.5 Introduction The C Programming Language C Standard Library C++ and Other C-Based Languages Typical

More information

Self-test Programming Fundamentals

Self-test Programming Fundamentals Self-test Programming Fundamentals Document: e0824test.fm 16 January 2018 ABIS Training & Consulting Diestsevest 32 / 4b B-3000 Leuven Belgium TRAINING & CONSULTING INTRODUCTION TO THE SELF-TEST PROGRAMMING

More information

OCR H446 A-Level Computer Science

OCR H446 A-Level Computer Science Name: Class Teacher: Date: OCR H446 A-Level Computer Science REVISION BOOKLET 2.3 ALGORITHMS Content in H446 A-Level Computer Science: 1.1 The characteristics of contemporary processors, input, output

More information

Two Approaches to Algorithms An Example (1) Iteration (2) Recursion

Two Approaches to Algorithms An Example (1) Iteration (2) Recursion 2. Recursion Algorithm Two Approaches to Algorithms (1) Iteration It exploits while-loop, for-loop, repeat-until etc. Classical, conventional, and general approach (2) Recursion Self-function call It exploits

More information

COURSE OUTCOMES OF M.Sc(IT)

COURSE OUTCOMES OF M.Sc(IT) COURSE OUTCOMES OF M.Sc(IT) Sr. No Subject Code Subject Name Sem-I CO Status Course Outcomes 1. A304101 PROGRAMMING USING C 2. A304102 FUNDAMENTALS OF COMPUTER & INFORMATION TECHNOLOGIES CO1 CO2 Understands

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

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \ BSc IT C Programming (2013-2017) Unit I Q1. What do you understand by type conversion? (2013) Q2. Why we need different data types? (2013) Q3 What is the output of the following (2013) main() Printf( %d,

More information

B.Sc II Year Computer Science (Optional)

B.Sc II Year Computer Science (Optional) Swami Ramanand Teerth Marathwad University, Nanded B.Sc II Year Computer Science (Optional) (Semester Pattern) ( W.E.F. June 2010) Paper No VI VII Paper Title Digital Electronics & 8085 Microprocessor

More information

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.095: Introduction to Computer Science and Programming Quiz I In order to receive credit you must answer

More information

Table of Contents EVALUATION COPY

Table of Contents EVALUATION COPY Table of Contents Introduction... 1-2 A Brief History of Python... 1-3 Python Versions... 1-4 Installing Python... 1-5 Environment Variables... 1-6 Executing Python from the Command Line... 1-7 IDLE...

More information

Python for Data Analysis

Python for Data Analysis Python for Data Analysis Wes McKinney O'REILLY 8 Beijing Cambridge Farnham Kb'ln Sebastopol Tokyo Table of Contents Preface xi 1. Preliminaries " 1 What Is This Book About? 1 Why Python for Data Analysis?

More information

Understanding. AutoLISP. Programming for Productivity, Second Edition. William and Denise Kramer. ö Delmar. Publishers Inc.

Understanding. AutoLISP. Programming for Productivity, Second Edition. William and Denise Kramer. ö Delmar. Publishers Inc. Understanding AutoLISP Programming for Productivity, Second Edition William and Denise Kramer ö Delmar Publishers Inc. Contents Introduction xxi 1. Introduction to AutoLISP 1 Historical Perspective 1 How

More information

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May www.jwjobs.net R10 SET - 1 II B. Tech I Semester, Supplementary Examinations, May - 2012 (Com. to CSE, IT, ECC ) Time: 3 hours Max Marks: 75 *******-****** 1. a) Which of the given options provides the

More information

Semester: I Credits: 5. Category: MC No.of hrs/week: 5 CA PROGRAMMING IN C

Semester: I Credits: 5. Category: MC No.of hrs/week: 5 CA PROGRAMMING IN C Semester: I Credits: 5 Category: MC No.of hrs/week: 5 CA1505 - PROGRAMMING IN C Objective: This course aims at explaining the basic concepts of computers and an easy understanding of C Language by the

More information

OUTCOMES BASED LEARNING MATRIX

OUTCOMES BASED LEARNING MATRIX OUTCOMES BASED LEARNING MATRIX Course: CTIM 372 Advanced Programming in C++ Department: Computer Technology and Information Management 3 credits/4 contact hours Description: This course is a continuation

More information

Python Basics. Lecture and Lab 5 Day Course. Python Basics

Python Basics. Lecture and Lab 5 Day Course. Python Basics Python Basics Lecture and Lab 5 Day Course Course Overview Python, is an interpreted, object-oriented, high-level language that can get work done in a hurry. A tool that can improve all professionals ability

More information

A Programming Approach with C DHARMENDER SINGH KUSHWAHA

A Programming Approach with C DHARMENDER SINGH KUSHWAHA DATA STRUCTURES A Programming Approach with C SECOND EDITION DHARMENDER SINGH KUSHWAHA Associate Professor Department of Computer Science and Engineering Motilal Nehru National Institute of Technology

More information