Option D is correct.
Explanation :
- In option A, it is not mandatory that a function will have arguments and it will return a value.
- In option B, no formula begins with =.
- In option C, it is not necessary to begin with /.
- In option D, MAX function should return maximum value in the set given.
Thus, option D is correct because arguments of a function are always enclosed within parentheses
Example:
SUM (30,70)
Answer:
The code to this question can be given as:
Code:
public interface Test //define interface
{
public abstract Duration getDuration(); //define method
getDuration.
public abstract Result check(int a);
//define method
check .
public abstract double getScore();
//define method getScore.
}
Explanation:
In the above code, we define an interface that is "Test" inside an interface, we define three methods that can be defined as:
- First, we define a method that is "getDuration" that method returns Duration as an object.
- Second, we define a method that is "check" this method accepts an integer parameter that is a and return Result.
- The third method is "getScore" this method will return a double value.
Answer:
Option A is the correct answer for the above question.
Explanation:
- The computer is a system that processes the data to produce information. For any computer system when the data is processed then it will form the information.
- The user gives some instruction to process that can also be called the program. Then the computer takes the instruction and processes the data on behalf of the instruction and for the information because in any system when data is processed it can form the information.
- The above question says that the computer follows the instruction to process the data to produce the information which is correct as described above. Hence True is the correct answer to the above question.
Answer:
Explanation:
The following is written in Java. It creates the function num_eights and uses recursion to check how many times the digit 8 appears in the number passed as an argument. A test case has been created in the main method and the output can be seen in the image below highlighted in red.
public static int num_eights(int pos){
if (pos == 0)
return 0;
if (pos % 10 == 8)
return 1 + num_eights(pos / 10);
else
return num_eights(pos / 10);
}