05introIO_3014

05introIO_3014 - Lecture File 05 COP 3014 September 17,...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture File 05 COP 3014 September 17, 2008 A. Ford Tyson 1 COP 3014 Lecture File 05 ± Input and Output I/O streams 1 – I/O streams – Intro to objects and classes – Interactive I/O – Formatting output Copyright 1997-present, Ann Ford Tyson Announcements ± Upcoming lecture order: – Cover 05 (IO) • read material on output formatting on your own – Next 07 (if and switch statements) – Next 08 (if and program design) 2 – Come back to 06 (advanced IO) after that ± Comments on project 2 – Two things programmers do in real world • Follow the specs • Follow the provided style guidelines – Start early and come to office hours early if need help getting going on it – Remember to check FAQ page for information Input and Output ± All I/O is in essence, done one character at a time 3 ± Concept: I/O operations act on streams (sequences) of ASCII characters
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture File 05 COP 3014 September 17, 2008 A. Ford Tyson 2 ± cout standard output stream sequence of characters printed to the monitor I/O Streams 4 ± cin standard input stream sequence of characters input from the keyboard ± both cout and cin are data objects and are defined as classes What is an object? ± fundamental to concept of object- oriented programming (OOP) ± a program element which contains both 5 – data – a set of possible operations (member functions) which can act on that data ± class is the general name of the data type used to define objects ± Interactive I/O user enters data at keyboard user sees output on monitor ( console window) Standard I/O 6 ± C++ provides standard header files – iostream istream, ostream, cin, cout, endl, showpoint, fixed – iomanip setw, setprecision
Background image of page 2
Lecture File 05 COP 3014 September 17, 2008 A. Ford Tyson 3 #include <iostream> input data output data Interactive I/O 7 cin ( type istream ) class cout ( type ostream ) class Keyboard Screen executing program Example Output ± cout << "Hello there world!"; prints the string Hello there world!
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/14/2011 for the course COP 3014 taught by Professor Tyson during the Fall '10 term at FSU.

Page1 / 13

05introIO_3014 - Lecture File 05 COP 3014 September 17,...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online