COMPLETE QUESTION:
What does this method do?
public static int foo(String [][] a)
{
int b = 0;
for (int i = 0; i<a.length; i++)
{
b++;
}
return b;
}
Answer:
Returns the value of b which is the dimension of the array
Explanation:
The method foo accepts a multi dimension array and returns the dimension of the array. A complete code implementation and call to the method is given below:
<em>public class TestClass {</em>
<em> public static void main(String[] args) {</em>
<em> String [ ] [ ] arr = {{"gh","hj","fg", "re","tr"},{"","er","df","fgt", "tr"}};</em>
<em> System.out.println(foo(arr));</em>
<em> }</em>
<em> public static int foo(String [ ][ ] a)</em>
<em> {</em>
<em> int b = 0;</em>
<em> for (int i = 0; i<a.length; i++)</em>
<em> {</em>
<em> b++;</em>
<em> }</em>
<em> return b;</em>
<em> }</em>
<em>}</em>
The output from the code snippet is the value of b which is 2
Answer:
Wait
it eases off.
Get home,
gathered,
very close and look up –
we find it’s all right.
Play:
they be.
For life,
but all vanished
picture faces –
matter: I do or don’t.
More,
something
out of hold
squeeze it tightly
my best,
my best life.
Opened,
something –
back at that moment –
all marchers
the room, the door, the front
rang through the outside
Explanation:
Answer:
#include<iostream>
using namespace std;
int main () {
int n;
int odd=0,even=0;
cout<<"Enter the number of element store in the array: ";
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
for(int i=0;i<n;i++){
if(arr[i]%2==1){
odd++;
}else{
even++;
}
}
cout<<"The number of odd values is: "<<odd<<endl;
cout<<"The number of even values is: "<<even<<endl;
}
Explanation:
Include the library iostream for input/output.
Create the main function and declare the variables.
Then, print the message on the screen and store the value enter by the user for the size of the array. After that, take a for loop and store the values in the array enter by the user.
then, take a for loop for traversing to the array and check the condition for odd and even by using if-else statement.
for odd: If odd values divided by 2 it gives 1 remainder.
for even: If even values divided by 2 it gives zero remainder.
if condition true, then update the counter.
finally, print the result.
Try to explain slowly and with patience it takes time because she isn't used to it
Answer:
The answer is "Option a".
Explanation:
In cloud computing, it is also known as the model, that enables you for accessible, convenient, through the-demand network access to global computer resources, which can be rapid to get and published via low administrative effort.
Its recommending selection for the cloud providers support for the robust encryption, that has adequate replication processes in place, use user authentication, or provide ample clarity to customers regarding mechanisms that defend subscriptions against other subscriptions and the supplier.