1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elena-2011 [213]
4 years ago
14

The elements of an integer-valued array can be set to 0 (i.e., the array can be cleared) recursively as follows: An array of siz

e 0 is already cleared; Otherwise, set the last of the uncleared elements of the array to 0, and clear the rest of the array Write a void method named clear that accepts an integer array, and the number of elements in the array and sets the elements of the array to 0.
Computers and Technology
1 answer:
dangina [55]4 years ago
4 0

Answer:

The method definition to this question can be given as:

Method definition:

public void clear(int[] arr, int num) //define method clear.

{

   if (num == 0) //if block

{

       return 0;  return value.

}

else //else block

{

 arr[num - 1] = 0; //assign value in arr.

return arr[];  //return value.

}

}

clear(arr, num - 1);   //calling

Explanation:

The description of the above method definition as follows:

  • Firstly we define a method that is "clear" that does not return any value because its return type is "void". This method accepts two integer variables that are "arr[] and num" where arr[] is an array variable and num is an integer variable.
  • Inside a method, we use a conditional statement in if block we check that num variable value is equal to 0. if this condition is true so, it will return 0 otherwise it will go to else block in else block it will assign value in variable arr[num-1] that is "0" and return arr value.

You might be interested in
Why not to use settimeout in angular.
barxatty [35]

Answer:

start with what you know

Explanation:

you can learn alot

4 0
3 years ago
What is the first computer was brought in nepal and for what purpose​
german

Answer:

The first computer bought in Nepal was IBM 1401 which was brought by the goverment in lease for the populations census of 1972.

7 0
3 years ago
Read 2 more answers
Give a recursive (or non-recursive) algorithm to compute the product of two positive integers, m and n, using only addition and
LiRa [457]

Answer:

Multiply(m,n)

1. Initialize product=0.

2. for i=1 to n

3.      product = product +m.

4. Output product.

Explanation:

Here we take the variable "product" to store the result m×n. And in this algorithm we find m×n by adding m, n times.

6 0
4 years ago
Refer to the film, actor, and film_actor tables of the Sakila database. The tables in this lab have the same columns and data ty
julsineya [31]

Using the knowledge of computational language in python it is possible to write a code that organizes film, actor and film and actor at the same time.

<h3>Writting the code:</h3>

<em>SELECT a.last_name, a.first_name, ROUND(AVG(f.length)) AS 'average' </em>

<em>FROM film f </em>

<em>INNER JOIN film_actor fa ON f.film_id = fa.film_id</em>

<em>INNER JOIN actor a ON a.actor_id = fa.actor_id</em>

<em>GROUP BY a.last_name, a.first_name</em>

<em>ORDER BY average DESC, last_name ASC;</em>

See more about python at brainly.com/question/18502436

#SPJ1

5 0
2 years ago
A person attempts to access a server during a zone transfer to get access to a zone file. What type of server is that person try
DerKrebs [107]

Answer: DNS Server

Explanation:

DNS server is the server that has the database along with the IP addresses along with names of the host as well in a computer system. So, by accessing the zone file , the person is actually trying to manipulate the host that is present in the DNS server zone. DNS server helps in the execution of the particular software and maintaining the connection using some protocols.

4 0
3 years ago
Other questions:
  • In a transaction-processing system (tps), if the tps database can be queried and updated while the transaction is taking place,
    11·1 answer
  • Risa has a negative credit rating, and she feels obtaining a fresh loan credit is going to be quite difficult for her. Her frien
    15·1 answer
  • Write the 8-bit signed-magnitude, two's complement, and ones' complement representations for each decimal number: +25, + 120, +
    11·1 answer
  • Write a function DrivingCost() with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar
    12·1 answer
  • A type of VPN connection, where a single computer logs into a remote network and becomes, for all intents and purposes, a member
    13·1 answer
  • Create a subclass of Person called Lecturer that has 2 variables of its own: employeeNumber and salary. As in the above scenario
    12·1 answer
  • 11. You tried to turn on your desktop computer, but your desktop computer would not even turn on. You pressed the power button,
    8·1 answer
  • Your program has a loop. You want to exit the loop completely if the user guesses the correct word.
    6·2 answers
  • What's good computing?
    15·1 answer
  • I need help! Please please
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!