Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

__________________________________________________________________________ PART

ID: 3550913 • Letter: #

Question

__________________________________________________________________________

PART 1

______________________________________________________________

For each term in the left column, write the corresponding letter for the description that best matches it from the column on the right.


___ 1. Unformated I/O

___ 2. Formated I/O

___ 3. Parameterized stream

           manipulators.

___ 4. Stream-insertion operator

___ 5. Stream-extraction operator

___ 6. Stream

___ 7. Cascade form

___ 8. Format flags


----------------------------------------------------------------------------------------

a) Overloaded left-shift operator(<<).

b) Command, such as endl, that changes  

     a stream.

c) Chaining together a series of calls, such as

     cout << a << b <<

Explanation / Answer

1 -- d

2 -- h

3 -- g

4 -- a

5 -- f

6 -- i

7 -- b

8 -- c

9 -- e



a)


std::cout << std::left << std::setw(15) << "40000" << std::endl;

b)

string temp = "copy function";

char arr[1024];

strncpy(arr, temp.c_str(), sizeof(arr));

c)

cout<<200;

d)

std::cout<<"0x"<<std::hex<<100;

e) char result[1000];

int i=0;

do

{

result[i] = getchar();

i++;

}while(result[i]!='p'&&result[i]!=' ');


f)

std::cout<< std::setw(9) << "1.234" << std::endl;


g)

string str;

char arr[50];

cin>>str;

strncpy(arr,str.c_str(),sizeof(arr));