Name:     ID: 
 
Email: 

ITF c++

True/False
Indicate whether the statement is true or false.
 

 1. 

In this class, end brace comments are required.
 

 2. 

In this class, end brace comments are optional.
 

 3. 

In this class IDOC is optional.
 

 4. 

In this class, //date is one of the required lines of IDOC.
 

 5. 

A program will NOT compile if an end brace comment is missing.
 

 6. 

In this class, //name is one of the required lines of IDOC.
 

 7. 

The short cut for duplicating a line in the Bloodshed compiler is ctrl-d.
 

 8. 

In this class, //class period is one of the required lines of IDOC and is located at the bottom of the program.
 

 9. 

The following is an example of what we call IDOC

}//end main
 

 10. 

In this class, //name is one of the required lines of IDOC and is located at the bottom of the program.
 

 11. 

In this class, IDOC is located at the top of every program.
 

 12. 

The short cut for duplicating a line in the Bloodshed compiler is alt-d.
 

 13. 

In this class, IDOC is located at the bottom of every program.
 

 14. 

The short cut for duplicating a line in the Bloodshed compiler is ctrl-e.
 

 15. 

A program will compile if an end brace comment is missing.
 

 16. 

In this class, //date is one of the required lines of IDOC and is located at the bottom of the program.
 

 17. 

In our class, you will always add IDOC.
 

Multiple Choice
Identify the choice that best completes the statement or answers the question.
 

 18. 

What will the following code display?

   cout << "Four " << "score ";
   cout << "and " << "seven/n";
   cout << "years" << "ago" << endl;
a.
Four score and seven
yearsago
b.
Four score and seven
years ago
c.
Four score and seven/nyearsago
d.
Four
score
and
seven
yearsago
 

 19. 

What will the following code display?

int x = 0, y = 1, z = 2;
cout << x << y << z << endl;
a.
0  1  2
b.
0
1
2
c.
012
d.
xyz
 

 20. 

Look at the following program and answer the question that follows it.

1
 // This program displays my gross wages.
2
 // I worked 40 hours and I make $20.00 per hour.
3
 #include <iostream>
4
 using namespace std;
5
  
6
 int main()
7
 {
8
    int hours;
9
    double payRate, grossPay;
10
  
11
    hours = 40;
12
    payRate = 20.0;
13
    grossPay = hours * payRate;
14
    cout << "My gross pay is $" << grossPay << endl;
15
    return 0;
16
 }

Which line(s) in this program cause output to be displayed on the screen?
a.
8 and 9
b.
15
c.
13
d.
13 and 14
e.
14
 

 21. 

What will the following code display?

   cout << "Four" << "score" << endl;
   cout << "and" << "seven" << endl;
   cout << "years" << "ago" << endl;
a.
Four score and seven years ago
b.
Four
score
and
seven
years
ago
c.
Fourscore
andseven
yearsago
d.
Fourscoreandsevenyearsago
 

 22. 

What will the following code display?

   cout << "Four " << "score ";
   cout << "and " << "seven\n";
   cout << "years" << "ago" << endl;
a.
Four
score
and
seven
yearsago
b.
Four score and seven/nyearsago
c.
Four score and seven
yearsago
d.
Four score and seven
years ago
 

 23. 

Which is NOT a part of the IDOC?
a.
}//end main
b.
//date
c.
//period
d.
//name
e.
None of these.
f.
All of these.
 

 24. 

What will the following code display?

   cout << "Four" << "score" ;
   cout << "and" << "seven" ;
   cout << "years" << "ago" ;
a.
Fourscore
andseven
yearsago
b.
Four
score
and
seven
years
ago
c.
Four score and seven years ago
d.
Fourscoreandsevenyearsago
 

 25. 

Which character signifies the beginning of an escape sequence?
a.
//
b.
/
c.
{
d.
\
e.
#
 

 26. 

What is the output of the following statement?

cout << 4 * (15 / (1 + 3)) << endl;
a.
15
b.
72
c.
12
d.
63
e.
None of these
 

 27. 

What will the following code display?

int number = 7;
cout << "The number is " << "number" << endl;
a.
The number is 0
c.
The number is 7
b.
The number is7
d.
The number is number
 

 28. 

What will the following code display?

cout << "Monday";
cout << "Tuesday";
cout << "Wednesday";
a.
Monday
Tuesday
Wednesday
b.
MondayTuesdayWednesday
c.
"Monday"
"Tuesday"
"Wednesday"
d.
Monday Tuesday Wednesday
 

 29. 

What will the following code display?

   cout << "Four\n" << "score\n";
   cout << "and" << "\nseven";
   cout << "\nyears" << " ago" << endl;
a.
Four
score
and
seven
years ago
b.
Four
score
and seven
years ago
c.
Four score
and seven
years ago
d.
Four score and seven
years ago
 

 30. 

This control sequence is used to skip over to the next horizontal tab stop.
a.
\t
b.
\a
c.
\h
d.
\'
e.
\n
 

Short Answer
 

 31. 

What are the first 3 things you add to every program written in this class?
 



 
         Start Over