1.
In C++, programmers can use a class to create a large number of instance variables of the class's type.
Group of answer choices
True
False
2.
When a C++ programmer declares a function, they are required to state all of the following except
Group of answer choices
{}
The type of data, if any, returned by the function
The function name
The type of data, if any, sent to the function
3.
When a C++ programmer calls a function, she states all of the following except
Group of answer choices
{}
The actual run-time data values, if any, sent to the function
The function's name
The actual run-time data value, if any, returned to the function
4.
Supposed you want to write a function whose parameters are not modified by code executed in the function. That is, she wants the values from the calling's function to not be modified by the function being called. What kind of parameters should you use?
Group of answer choices
pass-by-value
pass-by-reference
pass-by-name parameters
array parameters
5.
Consider the following statements:
if ( i <= 5 ) { cout << "Hello "; } cout << "Goodbye";
based on the following variable declarations and initializations:
int i = 5; int j = 2; int k = 6;
When executed, the upper statements will print out:
Group of answer choices
Hello Goodbye
Hello
Goodbye
Nonthing will be printed
6.
Consider the following statements:
if ( i <= 5 ) { cout << "Hello "; } else { cout << "Goodbye"; }
based on the following variable declarations and initializations:
int i = 5; int j = 2; int k = 6;
When executed, the upper statements will print out:
Group of answer choices
Hello
Goodbye
Hello Goodbye
No answer text provided.
Ans
1. False
No class doesn't have instance member of its type but it can have static member of its type
2.{}
function name, datatype of parameters and return type is required
But {} is used when defining a function
3.{}
on function call, function name, values pass to the function,
4. pass-by-value
pass by value doesn't modify actual parameters
pass by reference pass the address
pass by name pass function definition
array parameter passes by reference
5. Hello Goodbye
if condition gets true and it prints Hello
and then goodbye is printed
6. Hello
if condition gets true Hello is printed. Hence else block do not execute.
If any doubt ask in the comments.
Get Answers For Free
Most questions answered within 1 hours.