ICOM%204015%20Advanced%20Programming - PowerPoint PPT Presentation

About This Presentation
Title:

ICOM%204015%20Advanced%20Programming

Description:

Ta's email email addresses. Jose Torres (jet_at_amadeus.uprm.edu) ... cout ' ' i ' stars'; cout endl; example2.cc. output. 8/25/09. ICOM 4015. 6 ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 10
Provided by: ValuedGate2254
Learn more at: http://www.ece.uprm.edu
Category:

less

Transcript and Presenter's Notes

Title: ICOM%204015%20Advanced%20Programming


1
ICOM 4015 Advanced Programming
  • Lecture 1
  • Computer/Human Interaction
  • (Part I)
  • Reading Chapter 11
  • (Up to I/O manipulators)

Prof. Bienvenido Velez
2
Computer/Human InteractionOutline
  • Administrivia
  • Output Streams
  • Input Streams

3
Administrivia
  • Read Chapters 1-2 DeitelDeitel
  • Lab meeting times changed
  • Please sign up for a lab
  • No labs this week
  • Tas email email addresses
  • Jose Torres (jet_at_amadeus.uprm.edu)
  • Jairo Valiente (jvaliente_at_amadeus.uprm.edu)
  • Accounts _at_ amadeus ready
  • USER Ids derived from student

4
Example 1
include ltiostreamgt main() for(int i0
ilt10 i) for(int j0 jlti j)
cout ltlt "" cout ltlt endl
example1.cc


output
5
Example 2
include ltiostreamgt main() for(int i0
ilt10 i) for(int j0 jlti j)
cout ltlt "" cout ltlt " " ltlt i ltlt "
stars" cout ltlt endl
example2.cc
0 stars 1 stars 2 stars 3 stars 4
stars 5 stars 6 stars 7
stars 8 stars 9 stars
output
6
OutputStream insertion operator
returns an output stream
cout ltlt expression
stream insertion operator
output stream
argument expression
7
Example 3
include ltiostreamgt main() int entered
cout ltlt Enter number of rows " cin gtgt
entered for(int i0 iltentered i)
for(int j0 jlti j) cout ltlt ""
cout ltlt " " ltlt i ltlt " stars" cout ltlt
endl
example3.cc
bvelez_at_amadeus gtgt example3 Enter number of
rows 7 0 stars 1 stars 2 stars 3
stars 4 stars 5 stars 6
stars bvelez_at_amadeus gtgt
shell
8
Example 4
include ltiostreamgt main() while (true)
cout ltlt " Enter number of rows (-1 to end) "
int entered cin gtgt entered if
(entered -1) break for(int i0
iltentered i) for(int j0 jlti j)
cout ltlt "" cout ltlt " " ltlt
i ltlt " stars" cout ltlt endl
example4.cc
bvelez_at_amadeus gtgt example4 Enter number of
rows(-1 to end) 5 0 stars 1 stars 2
stars 3 stars 4 stars Please enter an
integer (-1 to end) -1 bvelez_at_amadeus gtgt
shell
9
InputStream extraction operator
returns an input stream
cin gtgt variable
stream extraction operator
input stream
argument expression
Write a Comment
User Comments (0)
About PowerShow.com