1. It is legal to have both pass-by-value and pass-by-reference parameters in th
ID: 3572536 • Letter: 1
Question
1. It is legal to have both pass-by-value and pass-by-reference parameters in the same function declaration. TRUE or FALSE
2. An array can store integers and doubles together. TRUE or FALSE
3. Generally speaking, a function that returns a value is like a small program. The arguments to a function are like inputs to the "program", and the value returned are like outputs of the "program". TRUE or FALSE
4. An array of size 10, has only nine slots for storing values. TRUE or FALSE
5. The variables (elements) stored in an array must be integers. TRUE or FALSE
6. With the string class, this would compare two strings if (str1 ==str2). TRUE or FALSE
7. Arrays are always passed to a function using:
A. pass by value
B. arrays should be declared global
C. pass by array
D. you cannot pass arrays to a function
8. You can concatenate two string class string values (str1, str2) as follows:
A. str1 = str1 + str2
B. str1, str2
C. str1(str1:str2)
Explanation / Answer
1.
Statement :
It is legal to have both pass-by-value and pass-by-reference parameters in the same function declaration.
The above statement is true.
2.
Statement :
An array can store integers and doubles together.
Reason :
There different types of arrays are there corrospond to their data type.
The above statement is False.
3.
Statement :
Generally speaking, a function that returns a value is like a small program. The arguments to a function are like inputs to the "program", and the value returned are like outputs of the "program".
The above statement is true.
4.
Statement :
An array of size 10, has only nine slots for storing values.
Reason :
It has 10 slots starts from 0-9.
The above statement is False.
5.
Statement :
The variables (elements) stored in an array must be integers.
Reason :
There different types of arrays are there corrospond to their data type. The data types are like int,float,char,double...
The above statement is False.
6.
Statement :
With the string class, this would compare two strings if (str1 ==str2).
Example : if (str1 == str2)
The above statement is true.
7.
Arrays are always passed to a function using pass by array.
Example :
void myFunction(int param[10])
Option c is correct choice.
8.
You can concatenate two string class string values (str1, str2) as
Example :
str1 = str1 + str2.
Option a is correct choice.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.