CS 101 Computer Programming and Utilization



Similar documents
Appendix K Introduction to Microsoft Visual C++ 6.0

Lab 2 - CMPS 1043, Computer Science I Introduction to File Input/Output (I/O) Projects and Solutions (C++)

Chapter 1 Fundamentals of Java Programming

Ch 7-1. Object-Oriented Programming and Classes

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

AP Computer Science Java Subset

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 3: Input/Output

CISC 181 Project 3 Designing Classes for Bank Accounts

Basics of I/O Streams and File I/O

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science

Problems and Measures Regarding Waste 1 Management and 3R Era of public health improvement Situation subsequent to the Meiji Restoration

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

13 Classes & Objects with Constructors/Destructors

Computer Programming C++ Classes and Objects 15 th Lecture

Appendix M: Introduction to Microsoft Visual C Express Edition

Sequential Program Execution

WORKSPACE WEB DEVELOPMENT & OUTSOURCING TRAINING CENTER

MS Visual C++ Introduction. Quick Introduction. A1 Visual C++

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

CS101 Lecture 24: Thinking in Python: Input and Output Variables and Arithmetic. Aaron Stevens 28 March Overview/Questions

C++ INTERVIEW QUESTIONS

Syllabus Introduction to C++ Programming and Numerical Analysis Spring 2016

2. Advance Certificate Course in Information Technology

Classes and Pointers: Some Peculiarities (cont d.)

Repetition Using the End of File Condition

CEC225 COURSE COMPACT

Creating a Java application using Perfect Developer and the Java Develo...

Moving from CS 61A Scheme to CS 61B Java

Using C++ File Streams

Advanced Data Structures

Lecture 5: Java Fundamentals III

CS170 Lab 11 Abstract Data Types & Objects

Have both hardware and software. Want to hide the details from the programmer (user).

2/9/2010. Standard Approach to Distribution. Remote Procedure Calls (RPC) Example: Music Jukebox in the Cloud

CMSC Fundamentals of Computer Programming II (C++)

El Dorado Union High School District Educational Services

CS3600 SYSTEMS AND NETWORKS

Objectif. Participant. Prérequis. Remarque. Programme. C# 3.0 Programming in the.net Framework. 1. Introduction to the.

Fundamentals of Java Programming

How To Develop Software

The C Programming Language course syllabus associate level

Java CPD (I) Frans Coenen Department of Computer Science

FLORIDA STATE COLLEGE AT JACKSONVILLE COLLEGE CREDIT COURSE OUTLINE. Introduction to Programming with Visual Basic.NET

Course MS10975A Introduction to Programming. Length: 5 Days

The Online Grade Book A Case Study in Learning about Object-Oriented Database Technology

Uploads from client PC's to mercury are not enabled for security reasons.

Example of Standard API

A Laboratory Information. Management System for the Molecular Biology Lab

Learning Computer Programming using e-learning as a tool. A Thesis. Submitted to the Department of Computer Science and Engineering.

Class XII (Theory) C++

C++ Input/Output: Streams

Software documentation systems

It has a parameter list Account(String n, double b) in the creation of an instance of this class.

Course plan. MSc on Bioinformatics for Health Sciences Academic Year Qualification Master's Degree

Programming by Contract. Programming by Contract: Motivation. Programming by Contract: Preconditions and Postconditions

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is

Subject Name: Object Oriented Programming in C++ Subject Code:

What is a Loop? Pretest Loops in C++ Types of Loop Testing. Count-controlled loops. Loops can be...

Chapter 9 Text Files User Defined Data Types User Defined Header Files

Customer Deliverable C0 Request for Proposals (RFP)

Object Oriented Software Design II

1 Introduction. 2 An Interpreter. 2.1 Handling Source Code

CpSc212 Goddard Notes Chapter 6. Yet More on Classes. We discuss the problems of comparing, copying, passing, outputting, and destructing

Design Patterns in C++

CSC230 Getting Starting in C. Tyler Bletsch

Introduction to C++ Introduction to C++ Week 7 Dr Alex Martin 2013 Slide 1

Automation of Library (Codes) Development for Content Management System (CMS)

EP241 Computer Programming

INTRODUCTION TO OBJECTIVE-C CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 12 09/29/2011

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

6.1. Example: A Tip Calculator 6-1

CS106B Handout #5P Winter January 14, 2008

Real Time Programming: Concepts

D06 PROGRAMMING with JAVA. Ch3 Implementing Classes

SQL Programming. CS145 Lecture Notes #10. Motivation. Oracle PL/SQL. Basics. Example schema:

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

Visual Programming of Logic, Motion, and Robotics

Java Application Developer Certificate Program Competencies

Lesson 4 Web Service Interface Definition (Part I)

Information Security Management: Business Continuity Planning. Presentation by Stanislav Nurilov March 9th, 2005 CS 996: Info. Sec. Mgmt.

Aspect-oriented Refactoring of a J2EE Framework for Security and Validation Concerns

CIS 190: C/C++ Programming. Polymorphism

Polymorphism. Problems with switch statement. Solution - use virtual functions (polymorphism) Polymorphism

COSC 181 Foundations of Computer Programming. Class 6

Understanding DPI and Pixel Dimensions

CS107L Handout 02 Autumn 2007 October 5, 2007 Copy Constructor and operator=

Bitter, Rick et al "Object-Oriented Programming in LabVIEW" LabVIEW Advanced Programming Techinques Boca Raton: CRC Press LLC,2001

An Incomplete C++ Primer. University of Wyoming MA 5310

COSC 111: Computer Programming I. Dr. Bowen Hui University of Bri>sh Columbia Okanagan

Software Engineering Concepts: Testing. Pointers & Dynamic Allocation. CS 311 Data Structures and Algorithms Lecture Slides Monday, September 14, 2009

Basic Programming and PC Skills: Basic Programming and PC Skills:

On the Applicability of Workflow Management Systems for the Preservation of Business Processes

Programming with the Microsoft.NET Framework Using Microsoft Visual Studio 2005 (VB)

Master Module SNET2 Seminar & Project Summer Term 2010

Object Oriented Software Design II

UEE1302 (1102) F10 Introduction to Computers and Programming

An Internet Course in Software Development with C++ for Engineering Students

Java Crash Course Part I

Transcription:

CS 101 Computer Programming and Utilization Lecture 14 Functions, Procedures and Classes. primitive and objects. Files. Mar 4, 2011 Prof. R K Joshi Computer Science and Engineering IIT Bombay Email: rkj@cse.iitb.ac.in

Revision global s: s can share s member s usual input parameters but they can be accessed by any usual return value + sharing of private s class: set of member s + set of private s + constructor (+ destructor: we will talk about it later) dot operator: for invocation of member s a return value can be assigned as usual object: instance of a class class is like a type and object is like a value private vs. public many instance of a class can be created of private s define the state of an object at a given point of time

The model of s: body vs. invocation input parameters body: definitions local s, accesses to input parameters computing a return value invocation local s return Values

While pure s do not use history, procedures may use global input parameters procedure body: definitions local s, accesses to input parameters computing a return value invocation local s return Values

Inovcation can access the global procedure body: definitions local s, accesses to input parameters computing a return value global input parameters procedure invocation local s global return Values

Multiple invocations: separate copy of local s, but a shared copy of globals procedure body: definitions local s, accesses to input parameters computing a return value global input parameters input parameters procedure procedureinvocation invocation local s local s global return Values

Classes private s

Classes member s

Classes sharing of private s by member s

Classes constructor constructor

Classes constructor initializes private s constructor

Objects: Instances of classes Object 2 Object 3 Object 1 constructor

Objects: Each one keeps a separate copy of the set of private s Object 3 Object 2 Object 1 constructor

Objects: The dot operator to invoke member s on objects (also called sending messages to objects) Object 3 Object 2 Object 1 constructor Invoke a member Supplying input parameters

Objects: a result comes out of member invocation Object 3 Object 2 Object 1 constructor Out comes the return result Invoke a member Supplying input parameters

The object's state (private s) may get modified during member invocation Object 3 Object 2 Object 1 constructor Out comes the return result Invoke a member Supplying input parameters

Libraries of classes A pre implemented collections of classes Used for reusability Separately compiled and kept somewhere in the system The programmer includes the declarations The pre compiled libraries are linked before the executable file gets produced Recall separate compilation

Files A file is a unit of storage on disk You have different kinds of files on your disk Text files, documents Pictures, photographs Music Source code Executable files Lab handouts

Creating and accessing our own files through C++ You have so far used editors or copy commands to create your own files You can also create them from a program Or.. existing files can be accessed and modified from a program Scientific, data oriented computations Programs have computations Data comes in from files or goes out into files

File handling library Include <fstream> For input and output on files Classes For performing output on files For input from files For doing both both Class ofstream Class ifstream Class fstream

Some s of files open() opening a file is_open() checking if it's open eof() end of file reached? close() closing a file operator << for output to file operator >> input from file