Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Which of the following statements (a-d) about Table are true if the array Table if is defined as follows: float Table[] = { 0.9,

1. Which of the following statements (a-d) about Table are true if the array Table if is defined as follows: float Table[] = { 0.9, 0.8, 0.7, 0.6 };

A. There will be a compiler error because there is no value specified inside of the square brackets.

B. Table[1] contains the value 0.9

C. There are actually 5 values stored in table: the four listed above and the null terminator as the fifth element

D. There will be a compiler error because an array cannot be initialized when it is declared.

E. All of the statements (a-d) are false.

______________________________________________________________________________________

2.

The unsubscripted name of an array is __________

A. the address of the array.

B. what is used in calls to functions that expect an array to be passed.

C. both a and b are correct

_____________________________________________________________________

3/

Which of the following "chunks" of C++ code will print the contents of an array called ar that has been defined to hold 25 integer values and has been initialized with 25 integer values.

A. cout << ar;

B.for( int sub = 0; sub == 25; sub++ )
 cout << ar[sub] << " ";

C. for( int sub = 0; sub < 25; sub++ )

cout << ar[sub] << " ";

D. for( int sub = 0; sub < 25; sub++ );

cout << ar[sub] << " ";

_____________________________________________________________________

4. What will happen if a variable of type char called ch is typecasted as an integer and cout-ed? cout << (int) ch;

A.

The character will be displayed

B.

The cout statement will produce a run-time error

C.

The ASCII value of the character will be displayed

D.

The cout statement will not compile

_________________________________________________________________

5. The following line of code: temp = numAr[8];

A.

copies the value from the variable temp into position 8 of numAr

B.

copies the value from position 8 of numAr into the variable temp

C.

copies 8 values from numAr into the variable temp

D.

copies 8 into the variable temp

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What options or strategies should Don use with Frank?

Answered: 1 week ago

Question

List the three major factors that influence attraction.

Answered: 1 week ago