Answer:
cubeVolume = IMath.toThePowerOf(cubeSide, 3);
Explanation:
Following is the explanation for above statement:
Left side:
cubeVolume is a variable with data-type int, it will store the integer value that is the output from right side.
Right side:
- IMath is the class name.
- toThePowerOf is the built-in function that takes two arguments of data type int. First is the base and second is the power(exponent) separated by comma. In place of first argument that is the base variable we will pass the variable cubeSide that has been declared and initialize.
- Now the output will be stored in the variable cubeVolume.
i hope it will help you!
Answer:
The working principle of the computer system. Computers do the work primarily in the machine and we can not see, a control center that converts the information data input to output. This control center, called the central processing unit (CPU), How Computers Work is a very complex system.
Explanation:
Answer:
- public class FindDuplicate{
-
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
-
- int n = 5;
- int arr[] = new int[n];
-
- for(int i=0; i < arr.length; i++){
- int inputNum = input.nextInt();
- if(inputNum >=1 && inputNum <=n) {
- arr[i] = inputNum;
- }
- }
-
- for(int j =0; j < arr.length; j++){
- for(int k = 0; k < arr.length; k++){
- if(j == k){
- continue;
- }else{
- if(arr[j] == arr[k]){
- System.out.println("True");
- return;
- }
- }
- }
- }
- System.out.println("False");
- }
- }
Explanation:
Firstly, create a Scanner object to get user input (Line 4).
Next, create an array with n-size (Line 7) and then create a for-loop to get user repeatedly enter an integer and assign the input value to the array (Line 9 - 14).
Next, create a double layer for-loop to check the each element in the array against the other elements to see if there is any duplication detected and display "True" (Line 21 - 22). If duplication is found the program will display True and terminate the whole program using return (Line 23). The condition set in Line 18 is to ensure the comparison is not between the same element.
If all the elements in the array are unique the if block (Line 21 - 23) won't run and it will proceed to Line 28 to display message "False".
Answer:
Explanation:
mostTickets=0;
for (k=0; k< ndays; k++){
if (parkingTickets[k]>mostTickets) mostTickets=parkingTickets[k];
}