Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

15.) A function can return only one value. What can we do if more than one value is computed and needs to be returned? a.)

15.) A function can return only one value.

What can we do if more than one value is computed and needs to be returned?

a.) We could declare those values globally.

b.) We could create an array if all of the values are of the same data type, and return the array.

c.) We could capture the data to a set of arrays. Since the arrays are passed by reference to the function, the function would not need to return anything.
d.)

All of the above

16.) Random rnd = new Random(-1);

a.) and is an object instantiated of type Random and initiated with a -1
b.) rnd is an object of a random generator
c.) rnd produces a set of random numbers; however the when the object is created it will always produce the same set of random numbers.
d.) All of the above.

17.) A while loop and a for loop both can perform the same function.

for (int i = 0; i < N; i++) { statements }

Select the equivalent code using a while loop.

a.) while (i < N)

{

statements;

i++;

}

b.) int i = 0;

while (i < N)

{

statements;

}

c.) int i = 0;

while (i < N)

{

statements;

i++;

}

d.) None of the above.

Flag this Question

while ( true )

{

...

}

a.) This code will run forever
b.) Unless a break statement is implemented in the bode of the while loop, the code will never run forever.
c.) the expression in the while statement is always true and therefore the loop will be executed for ever.
d.) All of the above

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 2 Lnai 9285

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Joao Gama ,Alipio Jorge ,Carlos Soares

1st Edition

3319235249, 978-3319235240

More Books

Students also viewed these Databases questions

Question

If all nations used the SDR, what might the impact be on business?

Answered: 1 week ago

Question

Explain the various methods of job evaluation

Answered: 1 week ago

Question

Differentiate Personnel Management and Human Resource Management

Answered: 1 week ago

Question

Describe the functions of Human resource management

Answered: 1 week ago

Question

What are the objectives of Human resource planning ?

Answered: 1 week ago

Question

13. You always should try to make a good first impression.

Answered: 1 week ago