CS 117 Spring 2002 What's Next. Files How to get data from a file instead of the keyboard How to save data to a file You know most of this from using.

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 1.
Advertisements

Copyright © 2002 Pearson Education, Inc. Slide 1.
Engineering Problem Solving With C++ An Object Based Approach Additional Topics Chapter 10 Programming with Classes.
Chapter 11 Operator Overloading; String and Array Objects Chapter 11 Operator Overloading; String and Array Objects Part I.
1 Records C++ Structs Chapter 14 2 What to do with records?  Declaring records  Accessing records  Accessing the field of a record  What is a union?
Object Oriented Intro. Objectives Why Object-Oriented? Real-World Object/Programmed Objects? What we want in objects? Object Relationships?
1 Arrays and Strings Chapter 9 2 "All students to receive arrays!" reports Dr. Austin. Declaring arrays scores :
Introduction to Programming Lecture 15. In Today’s Lecture Pointers and Arrays Manipulations Pointers and Arrays Manipulations Pointers Expression Pointers.
Operator Overloading. Introduction Operator overloading –Enabling C++’s operators to work with class objects –Using traditional operators with user-defined.
1 Classes and Data Abstraction Chapter What a Class ! ! Specification and implementation Private and public elements Declaring classes data and.
AU/MITM/1.6 By Mohammed A. Saleh 1. Introducing the string Class  Instead of using a character array to hold a string, you can use a type string variable.
CS 1620 File I/O. So far this semester all input has been from keyboard all output has been to computer screen these are just two examples of where to.
CS-1030 Dr. Mark L. Hornick 1 IOStreams revisited Streams, strings, and files.
1 Engineering Problem Solving With C++ An Object Based Approach Chapter 4 Programming with Data Files.
Chapter 14: Overloading and Templates
Chapter 11 Separate Compilation and Namespaces Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 12A Separate Compilation and Namespaces For classes this time.
CS 117 Spring 2002 Classes Hanly: Chapter 6 Freidman-Koffman: Chapter 10, intro in Chapter 3.7.
1 September 6, 2005CS150 Introduction to Computer Science I What Actions Do We Have Part 1 CS150 Introduction to Computer Science I.
1 Lecture 29 Chapter 11 Structured Types, Data Abstraction and Classes Dale/Weems/Headington.
 Wednesday, 10/16/02, Slide #1 CS106 Introduction to CS1 Wednesday, 10/16/02  QUESTIONS??  Today:  Return and discuss Test #1  Input from and output.
Wednesday, 11/6/02, Slide #1 CS 106 Intro to CS 1 Wednesday, 11/6/02  QUESTIONS?? – HW # 4 due Monday  Today:  Return HW #3  Arrays (Chap. 10)  Reading:
CS 117 Spring 2002 Review for Exam 3 arrays strings files classes.
Program Input and the Software Design Process ROBERT REAVES.
11 Introduction to Object Oriented Programming (Continued) Cats II.
UNFORMATTED INPUT OUTPUT. Topics to be discussed……………….. overloaded operators >> and and
Hello AP Computer Science!. What are some of the things that you have used computers for?
Beginning C++ Through Game Programming, Second Edition by Michael Dawson.
Chapter 8 Data File Basics.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Defining New Types Lecture 21 Hartmut Kaiser
1 Mr. Muhammad Hanif Lecturer Information Technology MBBS Campus Dadu University of SIndh.
1 CS161 Introduction to Computer Science Topic #13.
1 Chapter 11 Structured Data. 2 Topics 10.1 Abstract Data Types 10.2 Combining Data into Structures 10.3 Accessing Structure Members 10.4 Initializing.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11: Structured Data.
Chapter 9 Streams: Input stream: source of characters. Output stream: destination for characters. Up to now the input stream has defaulted to the keyboard.
CSE 332: C++ IO We’ve Looked at Basic Input and Output Already How to move data into and out of a program –Using argc and argv to pass command line args.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
Views of Data Data – nouns of programming world the objects that are manipulated information that is processed Humans like to group information Classes,
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
CHAPTER 6 ARRAYS IN C++ 2 nd Semester King Saud University College of Applied studies and Community Service CSC 1101 By: Fatimah Alakeel Edited.
Chapter 8 Arrays. A First Book of ANSI C, Fourth Edition2 Introduction Atomic variable: variable whose value cannot be further subdivided into a built-in.
Chapter 9 Separate Compilation and Namespaces. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Slide 2 Overview Separate Compilation (9.1)
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 12 Separate Compilation and Namespaces.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 12 Separate Compilation and Namespaces.
Chapter More on Classes Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
11 Introduction to Object Oriented Programming (Continued) Cats.
CS162 External Data Files 1 Today in CS162 External Files What is an external file? How do we save data in a file?
1 Data Structures CSCI 132, Spring 2014 Lecture 2 Classes and Abstract Data Types Read Ch Read Style Guide (see course webpage)
Introduction to Arrays. Learning Objectives By the end of this lecture, you should be able to: – Understand what an array is – Know how to create an array.
CS 1430: Programming in C++ 1. File Input in VS Project Properties Debugging Command Arguments quiz8-1.out We want to know how to do it ourselves, right?
Dictionaries and File I/O George Mason University.
1 C++ Classes & Object Oriented Programming Overview & Terminology.
1 Classes and Data Abstraction Chapter What a Class ! ! Specification and implementation Private and public elements Declaring classes data and.
Chapter 4 Strings and Screen I/O. Objectives Define strings and literals. Explain classes and objects. Use the string class to store strings. Perform.
Introduction Every program takes some data as input and generate processed data as out put . It is important to know how to provide the input data and.
CS212: Object Oriented Analysis and Design
I/O Streams File I/O 2-D array review
What Actions Do We Have Part 1
Chapter 6 Arrays in C++ 2nd Semester King Saud University
Anatomy of a Class & Method
Classes CS 401 (an excerpt).
Separate Compilation and Namespaces
C Stuff CS 2308.
Classes and Data Abstraction
Programming with Data Files
Text Files All the programs you've seen so far have one thing in common: Any data the program uses or calculates is lost when the program ends. In order.
File I/O in C++ I.
From C to C++: Summary of weeks 1 - 4
File I/O in C++ I.
Presentation transcript:

CS 117 Spring 2002 What's Next

Files How to get data from a file instead of the keyboard How to save data to a file You know most of this from using cin and cout

Arrays Often you have a number of variables for different instances of the same thing –the number of atoms of each element in an amino acid –test scores for each student in a class arrays let you declare variables that have multiple components –now you can use loops to process the data

Classes Classes are what makes C++ object oriented –you can create your own types –encapsulate - hide details from the user –simplifies development by separating a program into nearly independent parts

Examples Classes you've already seen –string –istream (cin) and ostream (cout) classes you could have used –point class that holds an x and a y value (or an r and a theta value) –amino class to hold amino acid name and number of atoms of of each element

Road Map Files –Hanly Chapter 9 –Friedman-Koffman Chapter 8 Arrays –Hanly Chapter 7 –Friedman-Koffman Chapter Classes –Hanly Chapter 6 –Friedman-Koffman Chapter