Answer: Only A and C
Explanation: Default constructor is a constructor that has parameters with the values that are default or has no arguments/parameter present. Default constructor is not declared in the class rather it gets generated by itself when not defined.
Class is defined with data members, functions, objects etc are considered as per the requirement given by the user .It is the user defined concept.
Statement (B) is incorrect because static method is used for accessing the static members of the particular class and manipulate the value of it.
Thus, only statement (A) and (C) are correct.
Answer:Decisions are only as valid as the information on which they are based. Management information systems improve your decision-making, because they provide information that is accurate, timely, relevant and complete.
Explanation:
Decisions are only as valid as the information on which they are based. Management information systems improve your decision-making, because they provide information that is accurate, timely, relevant and complete.
Answer:
The solution code is written in Python 3
- def findStr(stringList, c):
- output = []
- for currentStr in stringList:
- if c not in currentStr.lower():
- output.append(currentStr)
- return output
-
- strList = ["Apple", "Banana", "Grape", "Orange", "Watermelon"]
- print(findStr(strList, "g"))
Explanation:
Firstly, we can create a function and name it as findStr which takes two input parameters stringList and a character, c (Line 1).
Create a list that will hold the list of strings that do not contain the input character (Line 2).
Create a for-loop to traverse through each string in the list (Line 3).
In the loop, check if the input character is not found in the current string (Line 4), if so, add the current string to the output list (Line 5). Please note we also need to convert the current string to lowercase as this program should ignore the casing.
After completion the loop, return the output list (Line 7).
We can test the function using a sample string list and input character "g" (Line 9 - 10). We shall get the output as follows:
['Apple', 'Banana', 'Watermelon']
Answer:
True
Explanation:
Run-time parameters passed to a function allow you to use different values each time the function is called. Let us consider an example:
int add(int a,int b){
return a+b;
}
Now we can execute the same function with different parameters at runtime:
add(3,4) returns 7.
add(1,2) return 3.
add (10,1) return 11.
During each invocation , the formal function parameters are substituted by actual runtime values and the function code is executed.