For the program in Fig. 5.34, state the scope (either function scope, global namespace scope, local scope or function-prototype scope) of each of the following elements:
```
#include
using namespace std;
int cube( int y ); // function prototype
int main()
{
int x;
for ( x = 1; x <= 10; x++ ) // loop 10 times
cout << cube( x ) << endl; // calculate cube of x and output results
} // end main
// definition of function cube
int cube( int y )
{
return y * y * y;
} // end function cube
```
a) The variable x in main.
b) The variable y in cube.
c) The function cube.
d) The function main.
e) The function prototype for cube.
f) The identifier y in the function prototype for cube.
a) block scope.
b) block scope.
c) global namespace scope.
d) global namespace scope.
e) global namespace scope.
f) function-prototype scope.
You might also like to view...
All of the following is an element of the Windows 7 login screen, EXCEPT _____.
A. icons that represent each of the users B. the Easy of access icon C. system version and edition D. the Start button
An outline that was created in Word using ________ styles can be imported into a PowerPoint presentation that includes slide titles and bullet levels
Fill in the blank(s) with correct word
Which of the following is not a way that a company can implement VoIP?
a. Replace an existing PBX voice tie line. b. Upgrade the company's existing PBX. c. Switch the company over to a partial IP telephone system. d. All the above are ways to implement VoIP.
Case Based Critical Thinking Questions ? Case 2-2 Antoinette is part of a college department creating a number of student files with Microsoft Excel. She is working on a student retention project and wants to produce a worksheet that can alert faculty of student progress and current grade status. ? ? Antoinette wants all her worksheets to have the same formatting for text, colors, and graphical effects applied to create a specific look and feel. Antoinette needs to apply a _____.
A. theme B. template C. style D. font