Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 ( 7 points ) What is output by the code below? int dRay [ ] = { 3 3 , 1 4 ,

Question 1(7 points)
What is output by the code below?
int dRay[]={33,14,37,11,27};
cout << dRay[0];
Question 1 options:
a)
14
b)
index out of bounds
c)
11
d)
33
Question 2(7 points)
What is output by the code below?
int dRay[]={33,14,37,11,27};
cout << dRay[4];
Question 2 options:
a)
11
b)
27
c)
33
d)
index out of bounds
Question 3(7 points)
What is output by the code below?
int eRay []={33,14,37,11,27};
cout << eRay[5];
Question 3 options:
a)
5
b)
index out of bounds
c)
27
d)
14
Question 4(7 points)
What is output by the code below?
int nRay[10];
for(int i=0; i<10; i++)
{
nRay[i]= i*2;
}
cout << nRay[8];
Question 4 options:
a)
10
b)
18
c)
2
d)
16
Question 5(8 points)
What is output by the code below?
int sRay []={2,12,11,45,22,36,5,3,1};
int stuff =0;
for(int i =0; i<9; i++)
if(sRay[i]%2==1)
stuff = stuff + sRay[i];
cout << stuff;
Question 5 options:
a)
72
b)
68
c)
28
d)
65
Question 6(8 points)
What is output by the code below?
int mrTRay[]={3,5,6,7,2};
int bunch =0;
for(int i =0; i <5; i++)
bunch = bunch + mrTRay[i];
int avg = bunch /5;
cout << avg;
Question 6 options:
a)
4,0
b)
4.6
c)
3.5
d)
4
Question 7(8 points)
Which of the following statements declares alpha to be an array of 25 components of the type int?
Question 7 options:
a)
int alpha[25];
b)
int alpha[2][5];
c)
int array alpha[25][25];
d)
int array alpha[25];
Question 8(8 points)
In a(n)____________________ data type, each data item is a collection of other data items.
Question 8 options:
a)
double
b)
simple
c)
structured
d)
integer
Question 9(8 points)
If an array index goes out of bounds, the program always terminates in an error.
Question 9 options:
True
False
Question 10(8 points)
Assume you have the following declaration int beta[50];. Which of the following is a valid element of beta?
Question 10 options:
a)
beta['2']
b)
beta['50']
c)
beta[0]
d)
beta[50]
Question 11(8 points)
Assume you have the following declaration double salesData[1000];. Which of the following ranges is valid for the index of the array salesData?
Question 11 options:
a)
0 through 1000
b)
0 through 999
c)
1 through 1000
d)
1 through 1001
Question 12(8 points)
Assume you have the following declaration char nameList[100];. Which of the following ranges is valid for the index of the array nameList?
Question 12 options:
a)
1 through 100
b)
0 through 100
c)
1 through 101
d)
0 through 99
Question 13(8 points)
All components of an array are of the same data type.
Question 13 options:
True
False

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

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

What is duress? How does it relate to the idea of consent?

Answered: 1 week ago