SlideShare a Scribd company logo
1 of 57
OObbjjeecctt oorriieenntteedd PPrrooggrraammmmiinngg 
wwiitthh CC++++ 
IInnppuutt aanndd OOuuttppuutt iinn CC++++ 
By 
Nilesh Dalvi 
LLeeccttuurreerr,, PPaattkkaarr--VVaarrddee CCoolllleeggee.. 
http://www.slideshare.net/nileshdalvi01
Introduction 
• Every program takes some data as input and 
generates processed data as output. 
• C++ supports set of I/O functions. 
• C++ uses the concepts of stream and stream 
classes to implement its I/O operations with console 
and disk files. 
• In this chapter we will discuss how stream classes 
support the console-oriented I/O operations. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Streams in C++ 
• Stream is a sequence of bytes. 
• If data is received from input devices in 
sequence then it is called as source stream. 
• When data is passed to output devices then 
it is called destination. 
• The data is received from keyboard or disk 
and can be passed on to monitor or to the 
disk. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Streams in C++ 
Streams in I/O devices 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Streams in C++ 
• Data in source stream can be used as input 
data by program . 
• Source stream is called as input stream. 
• Destination stream that collects output data 
from the program is known as output 
stream. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Streams in C++ 
Input and output streams 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Streams Classes 
• C++ streams based are based on class and 
object theory. 
• C++ has a number of stream classes that 
are used to work with console and file 
operations. 
• These classes are known as streams classes. 
• All these classes are declared in the header 
file <iostream>. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Streams Classes 
Hierarchy of streams classes 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Streams Classes 
• Classes istream and ostream are derived 
classes of base class ios. 
• streambuf handles the buffer by providing 
the facilities to flush and pour the buffer. 
• iostream is derived from classes istream 
and ostream by using multiple inheritance. 
• ios class is a virtual class which avoid 
ambiguity 
• ios class has an ability to handle formatted 
and unformatted I/O operations. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Streams Classes 
Class Name Contents 
ios • Contains basic facilities that are used by all 
other input and output classes 
istream • Inherits properties of ios. 
• Declares input function get(), getline(), read(). 
• Contains overloaded extraction >> operator 
ostream • Inherits properties of ios. 
• Declares input function put(), write(). 
• Contains overloaded insertion << operator 
iostream • Inherits properties of ios, istream and ostream. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Unformatted console I/O operations 
Input and output streams 
• Input stream uses cin object to read data 
• Output stream uses cout object to display 
data on the screen. 
• Data type is identified by these functions 
using operator overloading << (insertion) 
and >> (extraction). 
• The >> operator is overloaded in istream 
class 
• The << operator is overloaded in ostream 
class 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Working of cin and cout statements 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Unformatted console I/O operations 
Input Stream 
• It does read operation through keyboard. 
• It uses cin object. 
• cin statement uses >> operator before 
variable name. 
• Syntax: 
cin >> variable; 
• Example: 
int weight; 
cin >> weight; 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Unformatted console I/O operations 
Output Stream 
• It displays the contents of variables on the 
screen. 
• It uses cout object. 
• cout statement uses << operator before 
variable name. 
• Syntax: 
cout << variable; 
• Example: 
int weight; 
cout << weight; 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Unformatted console I/O operations 
get() and put() 
• The single character input and output 
operations in C++ can be done with get() 
and put() functions. 
• get() – reads character. 
• put() – display the character. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Unformatted console I/O operations 
The get() has two syntaxes. 
• get(char) – assigns the input character to its 
argument. 
char c; 
cin.get(c); //get char from keyboard. 
while(c != 'n') 
{ 
cout << c; //display char on screen. 
cin.get(c); //get another char. 
} 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Unformatted console I/O operations 
The get() has two syntaxes. 
• get(void) – returns the input character. 
char c; 
c = cin.get(); 
value returned by function get() is assigned 
to c. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Unformatted console I/O operations 
• The function put() can be used to output a 
line of text, character by character. 
cout.put(‘X’); 
• Displays the character X. 
cout.put(68); 
• This statement will convert int value 68 to 
char value and display the character 
whose ASCII value is 68. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Character I/O with get() and put() 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Unformatted console I/O operations 
getline() and write() functions: 
• Displays a line of text by using line-oriented I/O 
functions getline() and write(). 
• getline()- reads a whole line of text that ends 
with a newline character(‘n’). 
• Invoked by using object cin as follows: 
cin.getline (line, size); 
• Reading is terminated as the newline char ‘n’ 
is encountered or size-1 characters are read. 
• Newline character is read but not saved. 
• Instead, it is replaced by null character. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Reading Strings with getline() 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Unformatted console I/O operations 
• write() function displays an entire line and 
has the following form: 
cout.write (line, size); 
• line – represents the name of the string to 
be displayed . 
• size - indicates number of characters to 
display. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Displaying String with write() 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Formatted Console I/O Operations 
• C++ provides various formatted console I/O 
functions for formatting the output. 
1. ios class functions and flags. 
2. Manipulators 
3. User-defined output functions 
• ios grants operations common to both input 
and output. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Formatted Console I/O Operations 
Function Working 
width() To set required field width. o/p will be displayed with 
given width. 
precision() To set number of decimal point for a float value. 
fill() To set character to fill in the blank space of the field. 
setf() To set various flags for formatting output. 
unsetf() To remove the flags setting 
Table: ios class functions 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Formatted Console I/O Operations 
Fig: Formatted functions with cout object 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Defining field width: width() 
• width() – defines width of a field necessary 
for the output of an item. 
cout.width (w); 
• w - field width(number of columns). 
• Output will be printed in a field of w 
characters wide at the right end of the field. 
• Field width should be specified for each 
item separately. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Defining field width: width() 
• For example, the statements 
cout.width(5); 
cout<<543<<12<<"n"; 
will produce following output: 
5 4 3 1 2 
• 543 is printed right-justified in the first five 
columns. 
• width(5) does not retain the setting for 
printing the 12. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Defining field width: width() 
• For example, the statements 
cout.width(5); 
cout<<543; 
cout.width(5); 
cout<<12<<"n"; 
This produce the following output: 
5 4 3 1 2 
• C++ never truncates the values and 
• If the specified width is smaller than the size of 
the value, C++ expands the field to fit the 
value. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Specifying field size with width() 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Setting precision : precision() 
• Default floating numbers are printed 
with six digits after the decimal point. 
• precision() – specifies number of digits 
to be displayed after the decimal 
point while printing the floating-point 
numbers, has the form: 
cout.precision(d); 
• d is the number of digits to the right of 
the decimal point. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Setting precision : precision() 
• For Examples: 
cout.precision(3); 
cout<<1.23456<<”n”; 
cout.precision(4); 
cout<<3.14159<<”n”; 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
width() and precision() 
• We can also combine the field 
specification with the precision setting. 
Example: 
cout.precision(2); 
cout.width(5); 
cout<<1.2345; 
• The output will be: 
1 . 2 3 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Setting precision : precision() 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Filling and Padding :fill() 
• We can use the fill() function to fill the 
unused positions by any desired 
character. 
• It is used in the following form: 
cout.fill(ch); 
• where ch represents the character 
which is used for filling the unused 
positions. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Filling and Padding :fill() 
• For Example: 
cout.fill(‘*’); 
cout.width(10); 
cout<<5250<<"n“; 
• The output would be: 
* * * * * * 5 2 5 0 
• Financial institutions and banks use this kind 
of padding while printing cheques so that 
no one can change the amount easily. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Formatting flags, bit-fields and setf() 
• setf() function can be used as follows: 
cout.setf(arg1,arg2); 
• arg1- one of the formatting flags defined in 
the class ios. 
• It specifies the format action required for 
the output. 
• arg2- Another ios constant known as bit 
field specifies the group to which the 
formatting flag belongs. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Table : Format-state-flags 
Flag Bit Field Flag Purpose 
ios::left 
ios::right Right-Justify all Output 
ios::adjustfield 
ios::internal Left-Justify sign or Base indicator and 
Left-Justify all Output 
right-justify rest of the number 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W). 
ios::dec 
ios::basefield 
Displays integer in base 10(decimal) 
format 
ios::oct Displays integer in base 8(octal) 
format 
ios::hex Displays integer in base 
16(hexadecimal) format 
ios::fixed 
ios::floatfield 
Use fixed point notation when 
displaying floating point numbers 
ios::scientific Use exponential notation when 
displaying floating point numbers
Formatting flags, bit-fields and setf() 
• Consider the following segment of code: 
cout.fill(‘*’); 
cout.setf(ios::left,ios::adjustfield); 
cout.width(10); 
cout<<"TABLE 1"<<"n"; 
• This will produce the following output: 
T A B L E 1 * * * 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Formatting flags, bit-fields and setf() 
• The statements 
cout.fill('*'); 
cout.precision(3); 
cout.setf(ios::internal,ios::adjustfield); 
cout.setf(ios::scientific,ios::floatfield); 
cout.width(15); 
cout<<-12.34567<<“n”; 
• will produce the following output: 
- * * * * * 1 . 2 3 5 e + 0 1 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Displaying Trailing Zeros And Plus Sign 
• If we print the numbers 10.75, 25.00 and 
15.50 using, 
cout.width(8); 
cout.precision(2); 
• Then output will be as follows: 
1 0 . 7 5 
2 5 
1 5 . 5 
• The trailing zeros in the second and third 
items have been truncated. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Displaying Trailing Zeros And Plus Sign 
• The above output would look better if they 
are printed as follows: 
10.75 
25.00 
15.50 
• setf() can be used with the flag 
ios::showpoint as a single argument to 
achieve this form of output. 
• For example, 
cout.setf(ios::showpoint); 
• which display tailing zeros 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Displaying Trailing Zeros And Plus Sign 
• plus sign can be printed before a positive 
number using the following statement: 
cout.setf(ios::showpos); 
• showpoint and showpos do not have any 
bit fields and therefore are used as single 
arguments in setf(). 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Displaying Trailing Zeros And Plus Sign 
• For example, the statements 
cout.setf(ios::showpoint); 
cout.setf(ios::showpos); 
cout.precision(3); 
cout.setf(ios::fixed,ios::floatfield); 
cout.setf(ios::internal,ios::adjustfield); 
cout.width(10); 
cout<<275.5<<"n"; 
• will produce the following output: 
+ 2 7 5 . 5 0 0 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Flag Lists 
• Following table lists the flags that do 
not posses a named bit field: 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Formatting with flags in setf() 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Managing output with manipulators: 
• The header file iomanip provides a set of 
functions called manipulators which can be 
used to manipulate the output formats. 
• Two or more manipulators can be used as a 
chain in one statement as shown below: 
cout<<manip1<<manip2<<manip3<<item; 
cout<<manip1<<item1<<manip2<<item2; 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Managing output with manipulators: 
• The most commonly used manipulators are 
shown in table. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Managing output with manipulators: 
• One statement can be used to format output 
for two or more values. 
• For example, the statement 
cout<<setw(5)<<setprecision(2)<<1.2345 
<<setw(10)<<setprecision(4)<<sqrt(2) 
<<setw(15)<<setiosflags(ios::scientific) 
<<sqrt(3)<<endl; 
• Will print all the three values in one line with the 
field size of 5,10,and 15 respectively. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Managing output with manipulators: 
• We can jointly use the manipulators and the 
ios functions in a program: 
cout.width(5); 
cout<<setprecision(2)<<1.2345 
<<setw(10)<<setprecision(4)<<sqrt(2) 
<<setw(15)<<setiosflags(ios::scientific) 
<<sqrt(3)<<endl; 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Designing Our Own Manipulators 
• General form for creating a manipulator is: 
ostream & manipulator(ostream & output) 
{ 
..... 
.....(code) 
..... 
return output; 
} 
• Here, the manipulator is the name of the 
manipulator 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Designing Our Own Manipulators 
• The following function defines a manipulator 
called unit that displays "inches": 
ostream & unit(ostream & output) 
{ 
output<<"inches"; 
return output; 
} 
• The statement 
cout << 36 << unit; 
• will produce the following output 
36 inches 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Designing Our Own Manipulators 
• We can also create manipulators that could 
represent a sequence of operations. Example: 
ostream & show(ostream & output) 
{ 
output.setf(ios::showpoint); 
output.setf(ios::showpos); 
output<<setw(10); 
return output; 
} 
• Manipulator show turns on the flags showpoint 
and showpos and sets the field width to 10. 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Designing Our Own Manipulators 
#include <iostream> 
#include <iomanip> 
ostream & curr(ostream & ostr) 
{ 
cout<< setprecision(2); 
cout<<”Rs. “; 
return ostr; 
} 
int main() 
{ 
float amt = 4.5476; 
cout<<curr<<amt; 
return 0; 
} 
//Output: Rs. 4.55 
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Input and output in C++

More Related Content

What's hot (20)

C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Templates in c++
Templates in c++Templates in c++
Templates in c++
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
 
Function in C program
Function in C programFunction in C program
Function in C program
 
Data types in c++
Data types in c++Data types in c++
Data types in c++
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
 
Constructor ppt
Constructor pptConstructor ppt
Constructor ppt
 
Structure of C++ - R.D.Sivakumar
Structure of C++ - R.D.SivakumarStructure of C++ - R.D.Sivakumar
Structure of C++ - R.D.Sivakumar
 
Array in c++
Array in c++Array in c++
Array in c++
 
Characteristics of OOPS
Characteristics of OOPS Characteristics of OOPS
Characteristics of OOPS
 
File handling in C++
File handling in C++File handling in C++
File handling in C++
 
String functions in C
String functions in CString functions in C
String functions in C
 
07. Virtual Functions
07. Virtual Functions07. Virtual Functions
07. Virtual Functions
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in Java
 

Viewers also liked (20)

Polymorphism
PolymorphismPolymorphism
Polymorphism
 
C++ io manipulation
C++ io manipulationC++ io manipulation
C++ io manipulation
 
14. Linked List
14. Linked List14. Linked List
14. Linked List
 
Managing console
Managing consoleManaging console
Managing console
 
C++ Files and Streams
C++ Files and Streams C++ Files and Streams
C++ Files and Streams
 
file handling c++
file handling c++file handling c++
file handling c++
 
Chap 12(files)
Chap 12(files)Chap 12(files)
Chap 12(files)
 
CHAPTER 4
CHAPTER 4CHAPTER 4
CHAPTER 4
 
cpp input & output system basics
cpp input & output system basicscpp input & output system basics
cpp input & output system basics
 
7. Multithreading
7. Multithreading7. Multithreading
7. Multithreading
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 
A presentation on types of network
A presentation on types of networkA presentation on types of network
A presentation on types of network
 
Variables and data types in C++
Variables and data types in C++Variables and data types in C++
Variables and data types in C++
 
Inheritance : Extending Classes
Inheritance : Extending ClassesInheritance : Extending Classes
Inheritance : Extending Classes
 
Overloading of io stream operators
Overloading of io stream operatorsOverloading of io stream operators
Overloading of io stream operators
 
File handling in_c
File handling in_cFile handling in_c
File handling in_c
 
C++ L01-Variables
C++ L01-VariablesC++ L01-Variables
C++ L01-Variables
 
Formatted input and output
Formatted input and outputFormatted input and output
Formatted input and output
 
Managing console input and output
Managing console input and outputManaging console input and output
Managing console input and output
 
11. Arrays
11. Arrays11. Arrays
11. Arrays
 

Similar to Input and output in C++

Similar to Input and output in C++ (20)

programming language in c&c++
programming language in c&c++programming language in c&c++
programming language in c&c++
 
Nitin Mishra 0301EC201039 Internship PPT.pptx
Nitin Mishra 0301EC201039 Internship PPT.pptxNitin Mishra 0301EC201039 Internship PPT.pptx
Nitin Mishra 0301EC201039 Internship PPT.pptx
 
C
CC
C
 
Oops lecture 1
Oops lecture 1Oops lecture 1
Oops lecture 1
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
 
FILE OPERATIONS.pptx
FILE OPERATIONS.pptxFILE OPERATIONS.pptx
FILE OPERATIONS.pptx
 
2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
 
Managing console input
Managing console inputManaging console input
Managing console input
 
C++ unit-1-part-11
C++ unit-1-part-11C++ unit-1-part-11
C++ unit-1-part-11
 
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
 
C++ theory
C++ theoryC++ theory
C++ theory
 
Variables
VariablesVariables
Variables
 
Overview of the Hive Stinger Initiative
Overview of the Hive Stinger InitiativeOverview of the Hive Stinger Initiative
Overview of the Hive Stinger Initiative
 
Lec-1c.pdf
Lec-1c.pdfLec-1c.pdf
Lec-1c.pdf
 
c++ UNIT II.pptx
c++ UNIT II.pptxc++ UNIT II.pptx
c++ UNIT II.pptx
 
Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming Language
 
Strings
StringsStrings
Strings
 
Data types and Operators
Data types and OperatorsData types and Operators
Data types and Operators
 
Aspdot
AspdotAspdot
Aspdot
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
 

More from Nilesh Dalvi

10. Introduction to Datastructure
10. Introduction to Datastructure10. Introduction to Datastructure
10. Introduction to DatastructureNilesh Dalvi
 
9. Input Output in java
9. Input Output in java9. Input Output in java
9. Input Output in javaNilesh Dalvi
 
6. Exception Handling
6. Exception Handling6. Exception Handling
6. Exception HandlingNilesh Dalvi
 
5. Inheritances, Packages and Intefaces
5. Inheritances, Packages and Intefaces5. Inheritances, Packages and Intefaces
5. Inheritances, Packages and IntefacesNilesh Dalvi
 
4. Classes and Methods
4. Classes and Methods4. Classes and Methods
4. Classes and MethodsNilesh Dalvi
 
3. Data types and Variables
3. Data types and Variables3. Data types and Variables
3. Data types and VariablesNilesh Dalvi
 
1. Overview of Java
1. Overview of Java1. Overview of Java
1. Overview of JavaNilesh Dalvi
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template LibraryNilesh Dalvi
 
Classes and objects
Classes and objectsClasses and objects
Classes and objectsNilesh Dalvi
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cppNilesh Dalvi
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops conceptsNilesh Dalvi
 

More from Nilesh Dalvi (17)

13. Queue
13. Queue13. Queue
13. Queue
 
12. Stack
12. Stack12. Stack
12. Stack
 
10. Introduction to Datastructure
10. Introduction to Datastructure10. Introduction to Datastructure
10. Introduction to Datastructure
 
9. Input Output in java
9. Input Output in java9. Input Output in java
9. Input Output in java
 
8. String
8. String8. String
8. String
 
6. Exception Handling
6. Exception Handling6. Exception Handling
6. Exception Handling
 
5. Inheritances, Packages and Intefaces
5. Inheritances, Packages and Intefaces5. Inheritances, Packages and Intefaces
5. Inheritances, Packages and Intefaces
 
4. Classes and Methods
4. Classes and Methods4. Classes and Methods
4. Classes and Methods
 
3. Data types and Variables
3. Data types and Variables3. Data types and Variables
3. Data types and Variables
 
2. Basics of Java
2. Basics of Java2. Basics of Java
2. Basics of Java
 
1. Overview of Java
1. Overview of Java1. Overview of Java
1. Overview of Java
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template Library
 
Templates
TemplatesTemplates
Templates
 
File handling
File handlingFile handling
File handling
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
 

Recently uploaded

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

Input and output in C++

  • 1. OObbjjeecctt oorriieenntteedd PPrrooggrraammmmiinngg wwiitthh CC++++ IInnppuutt aanndd OOuuttppuutt iinn CC++++ By Nilesh Dalvi LLeeccttuurreerr,, PPaattkkaarr--VVaarrddee CCoolllleeggee.. http://www.slideshare.net/nileshdalvi01
  • 2. Introduction • Every program takes some data as input and generates processed data as output. • C++ supports set of I/O functions. • C++ uses the concepts of stream and stream classes to implement its I/O operations with console and disk files. • In this chapter we will discuss how stream classes support the console-oriented I/O operations. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 3. Streams in C++ • Stream is a sequence of bytes. • If data is received from input devices in sequence then it is called as source stream. • When data is passed to output devices then it is called destination. • The data is received from keyboard or disk and can be passed on to monitor or to the disk. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 4. Streams in C++ Streams in I/O devices Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 5. Streams in C++ • Data in source stream can be used as input data by program . • Source stream is called as input stream. • Destination stream that collects output data from the program is known as output stream. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 6. Streams in C++ Input and output streams Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 7. Streams Classes • C++ streams based are based on class and object theory. • C++ has a number of stream classes that are used to work with console and file operations. • These classes are known as streams classes. • All these classes are declared in the header file <iostream>. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 8. Streams Classes Hierarchy of streams classes Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 9. Streams Classes • Classes istream and ostream are derived classes of base class ios. • streambuf handles the buffer by providing the facilities to flush and pour the buffer. • iostream is derived from classes istream and ostream by using multiple inheritance. • ios class is a virtual class which avoid ambiguity • ios class has an ability to handle formatted and unformatted I/O operations. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 10. Streams Classes Class Name Contents ios • Contains basic facilities that are used by all other input and output classes istream • Inherits properties of ios. • Declares input function get(), getline(), read(). • Contains overloaded extraction >> operator ostream • Inherits properties of ios. • Declares input function put(), write(). • Contains overloaded insertion << operator iostream • Inherits properties of ios, istream and ostream. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 11. Unformatted console I/O operations Input and output streams • Input stream uses cin object to read data • Output stream uses cout object to display data on the screen. • Data type is identified by these functions using operator overloading << (insertion) and >> (extraction). • The >> operator is overloaded in istream class • The << operator is overloaded in ostream class Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 12. Working of cin and cout statements Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 13. Unformatted console I/O operations Input Stream • It does read operation through keyboard. • It uses cin object. • cin statement uses >> operator before variable name. • Syntax: cin >> variable; • Example: int weight; cin >> weight; Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 14. Unformatted console I/O operations Output Stream • It displays the contents of variables on the screen. • It uses cout object. • cout statement uses << operator before variable name. • Syntax: cout << variable; • Example: int weight; cout << weight; Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 15. Unformatted console I/O operations get() and put() • The single character input and output operations in C++ can be done with get() and put() functions. • get() – reads character. • put() – display the character. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 16. Unformatted console I/O operations The get() has two syntaxes. • get(char) – assigns the input character to its argument. char c; cin.get(c); //get char from keyboard. while(c != 'n') { cout << c; //display char on screen. cin.get(c); //get another char. } Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 17. Unformatted console I/O operations The get() has two syntaxes. • get(void) – returns the input character. char c; c = cin.get(); value returned by function get() is assigned to c. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 18. Unformatted console I/O operations • The function put() can be used to output a line of text, character by character. cout.put(‘X’); • Displays the character X. cout.put(68); • This statement will convert int value 68 to char value and display the character whose ASCII value is 68. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 19. Character I/O with get() and put() Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 20. Unformatted console I/O operations getline() and write() functions: • Displays a line of text by using line-oriented I/O functions getline() and write(). • getline()- reads a whole line of text that ends with a newline character(‘n’). • Invoked by using object cin as follows: cin.getline (line, size); • Reading is terminated as the newline char ‘n’ is encountered or size-1 characters are read. • Newline character is read but not saved. • Instead, it is replaced by null character. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 21. Reading Strings with getline() Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 22. Unformatted console I/O operations • write() function displays an entire line and has the following form: cout.write (line, size); • line – represents the name of the string to be displayed . • size - indicates number of characters to display. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 23. Displaying String with write() Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 24. Formatted Console I/O Operations • C++ provides various formatted console I/O functions for formatting the output. 1. ios class functions and flags. 2. Manipulators 3. User-defined output functions • ios grants operations common to both input and output. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 25. Formatted Console I/O Operations Function Working width() To set required field width. o/p will be displayed with given width. precision() To set number of decimal point for a float value. fill() To set character to fill in the blank space of the field. setf() To set various flags for formatting output. unsetf() To remove the flags setting Table: ios class functions Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 26. Formatted Console I/O Operations Fig: Formatted functions with cout object Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 27. Defining field width: width() • width() – defines width of a field necessary for the output of an item. cout.width (w); • w - field width(number of columns). • Output will be printed in a field of w characters wide at the right end of the field. • Field width should be specified for each item separately. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 28. Defining field width: width() • For example, the statements cout.width(5); cout<<543<<12<<"n"; will produce following output: 5 4 3 1 2 • 543 is printed right-justified in the first five columns. • width(5) does not retain the setting for printing the 12. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 29. Defining field width: width() • For example, the statements cout.width(5); cout<<543; cout.width(5); cout<<12<<"n"; This produce the following output: 5 4 3 1 2 • C++ never truncates the values and • If the specified width is smaller than the size of the value, C++ expands the field to fit the value. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 30. Specifying field size with width() Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 31. Setting precision : precision() • Default floating numbers are printed with six digits after the decimal point. • precision() – specifies number of digits to be displayed after the decimal point while printing the floating-point numbers, has the form: cout.precision(d); • d is the number of digits to the right of the decimal point. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 32. Setting precision : precision() • For Examples: cout.precision(3); cout<<1.23456<<”n”; cout.precision(4); cout<<3.14159<<”n”; Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 33. width() and precision() • We can also combine the field specification with the precision setting. Example: cout.precision(2); cout.width(5); cout<<1.2345; • The output will be: 1 . 2 3 Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 34. Setting precision : precision() Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 35. Filling and Padding :fill() • We can use the fill() function to fill the unused positions by any desired character. • It is used in the following form: cout.fill(ch); • where ch represents the character which is used for filling the unused positions. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 36. Filling and Padding :fill() • For Example: cout.fill(‘*’); cout.width(10); cout<<5250<<"n“; • The output would be: * * * * * * 5 2 5 0 • Financial institutions and banks use this kind of padding while printing cheques so that no one can change the amount easily. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 37. Formatting flags, bit-fields and setf() • setf() function can be used as follows: cout.setf(arg1,arg2); • arg1- one of the formatting flags defined in the class ios. • It specifies the format action required for the output. • arg2- Another ios constant known as bit field specifies the group to which the formatting flag belongs. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 38. Table : Format-state-flags Flag Bit Field Flag Purpose ios::left ios::right Right-Justify all Output ios::adjustfield ios::internal Left-Justify sign or Base indicator and Left-Justify all Output right-justify rest of the number Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W). ios::dec ios::basefield Displays integer in base 10(decimal) format ios::oct Displays integer in base 8(octal) format ios::hex Displays integer in base 16(hexadecimal) format ios::fixed ios::floatfield Use fixed point notation when displaying floating point numbers ios::scientific Use exponential notation when displaying floating point numbers
  • 39. Formatting flags, bit-fields and setf() • Consider the following segment of code: cout.fill(‘*’); cout.setf(ios::left,ios::adjustfield); cout.width(10); cout<<"TABLE 1"<<"n"; • This will produce the following output: T A B L E 1 * * * Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 40. Formatting flags, bit-fields and setf() • The statements cout.fill('*'); cout.precision(3); cout.setf(ios::internal,ios::adjustfield); cout.setf(ios::scientific,ios::floatfield); cout.width(15); cout<<-12.34567<<“n”; • will produce the following output: - * * * * * 1 . 2 3 5 e + 0 1 Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 41. Displaying Trailing Zeros And Plus Sign • If we print the numbers 10.75, 25.00 and 15.50 using, cout.width(8); cout.precision(2); • Then output will be as follows: 1 0 . 7 5 2 5 1 5 . 5 • The trailing zeros in the second and third items have been truncated. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 42. Displaying Trailing Zeros And Plus Sign • The above output would look better if they are printed as follows: 10.75 25.00 15.50 • setf() can be used with the flag ios::showpoint as a single argument to achieve this form of output. • For example, cout.setf(ios::showpoint); • which display tailing zeros Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 43. Displaying Trailing Zeros And Plus Sign • plus sign can be printed before a positive number using the following statement: cout.setf(ios::showpos); • showpoint and showpos do not have any bit fields and therefore are used as single arguments in setf(). Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 44. Displaying Trailing Zeros And Plus Sign • For example, the statements cout.setf(ios::showpoint); cout.setf(ios::showpos); cout.precision(3); cout.setf(ios::fixed,ios::floatfield); cout.setf(ios::internal,ios::adjustfield); cout.width(10); cout<<275.5<<"n"; • will produce the following output: + 2 7 5 . 5 0 0 Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 45. Flag Lists • Following table lists the flags that do not posses a named bit field: Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 46. Formatting with flags in setf() Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 47. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 48. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 49. Managing output with manipulators: • The header file iomanip provides a set of functions called manipulators which can be used to manipulate the output formats. • Two or more manipulators can be used as a chain in one statement as shown below: cout<<manip1<<manip2<<manip3<<item; cout<<manip1<<item1<<manip2<<item2; Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 50. Managing output with manipulators: • The most commonly used manipulators are shown in table. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 51. Managing output with manipulators: • One statement can be used to format output for two or more values. • For example, the statement cout<<setw(5)<<setprecision(2)<<1.2345 <<setw(10)<<setprecision(4)<<sqrt(2) <<setw(15)<<setiosflags(ios::scientific) <<sqrt(3)<<endl; • Will print all the three values in one line with the field size of 5,10,and 15 respectively. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 52. Managing output with manipulators: • We can jointly use the manipulators and the ios functions in a program: cout.width(5); cout<<setprecision(2)<<1.2345 <<setw(10)<<setprecision(4)<<sqrt(2) <<setw(15)<<setiosflags(ios::scientific) <<sqrt(3)<<endl; Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 53. Designing Our Own Manipulators • General form for creating a manipulator is: ostream & manipulator(ostream & output) { ..... .....(code) ..... return output; } • Here, the manipulator is the name of the manipulator Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 54. Designing Our Own Manipulators • The following function defines a manipulator called unit that displays "inches": ostream & unit(ostream & output) { output<<"inches"; return output; } • The statement cout << 36 << unit; • will produce the following output 36 inches Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 55. Designing Our Own Manipulators • We can also create manipulators that could represent a sequence of operations. Example: ostream & show(ostream & output) { output.setf(ios::showpoint); output.setf(ios::showpos); output<<setw(10); return output; } • Manipulator show turns on the flags showpoint and showpos and sets the field width to 10. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 56. Designing Our Own Manipulators #include <iostream> #include <iomanip> ostream & curr(ostream & ostr) { cout<< setprecision(2); cout<<”Rs. “; return ostr; } int main() { float amt = 4.5476; cout<<curr<<amt; return 0; } //Output: Rs. 4.55 Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).

Editor's Notes

  1. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  2. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  3. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  4. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  5. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  6. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  7. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  8. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  9. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  10. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  11. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  12. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  13. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  14. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  15. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  16. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  17. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  18. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  19. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  20. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  21. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  22. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  23. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  24. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  25. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  26. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  27. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  28. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  29. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  30. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  31. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  32. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  33. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  34. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  35. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  36. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  37. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  38. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  39. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  40. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  41. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  42. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  43. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  44. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  45. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  46. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  47. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  48. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  49. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  50. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  51. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  52. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  53. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  54. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  55. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.
  56. Be selective. You do not need to cover both research and education. It does not need to be a long list. You can put down just one opportunity that you are really excited about. Just identify what you think are the biggest opportunities for your department faculty. Strike a balance between “thinking big” and being realistic. One way to think would be to say that if you were the Dean, you would invest in these opportunities. Remember the goal is to have national level prominence and visibility where our peer group will recognize our activities and accomplishments. For example, the NSF ERC on Particle Science and Technology As you go to the next slide, please bear in mind that there may well be very strong connections between this slide and the next on multi-disciplinary collaborations.