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 size 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.

Answers

Answer 1
Answer:

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.


Related Questions

If the driven shaft and the drive are at the same angle but turn in opposite directions, the gearing system is called a A. worm drive. B. chain drive. C. gear and pinion drive. D. belt drive.
Before a new electrical installation can be connected to the source of electricity, it must be examined and approved by A. a local inspection agency. B. an electrical code committee. C. the Underwriters Laboratories. D. the National Fire Protection Association.
A network administrator for a small company is contemplating how to scale the network over the next three years to accommodate projected growth. Which three types of information should be used to plan for network growth? (Choose three.)A. human resource policies and procedures for all employees in the companyB. documentation of the current physical and logical topologies *C. analysis of the network traffic based on protocols, applications, and services used on the network*D. history and mission statement of the companyE. inventory of the devices that are currently used on the network*F. listing of the current employees and their role in the company
Explain why a single 500 kg block of granite weathers much more slowly than 100 chunks of granite weighing 5 kg each.
Social networking websites put the responsibility for intellectual property on whom?

Which of the following is the process by which graphical content is created using the proper software ?a. 3-D printing
b. tracking
c. 3-D visualization
d. kerning

i know that the answer is c , but i don't understand how .

Answers

See it's option C because 3-D visualising means creating graphical content in computers now if we are creating it in computer means we are working with software so option C is correct there.

In which part of a professional email should you try to be brief, but highly descriptive? A. The subject line
B. The blind carbon copy (bcc)
C. The emoticons
D. The domain

Answers

The correct answer is A - the part of a professional email in which you should try to be brief, but highly descriptive, would be the subject line. It is important to write a good subject line, because this will effect the amount of attention paid to your email in the busy inbox of a professional company.

A student is recording a song on her computer. When the recording is finished, she saves a copy on her computer. The student notices that the saved copy is of lower sound quality than the original recording. Which of the following could be a possible explanation for the difference in sound quality?A. The song was saved using fewer bits per second than the original song.
B. The song was saved using more bits per second than the original song.
C. The song was saved using a lossless compression technique.
D. Some information is lost every time a file is saved from one location on a computer to another location.

Answers

Answer:

A. The song was saved using fewer bits per second than the original song.

Explanation:

A song can be recorded on the computer or any device ranging from bit rates 96 kbps to 320 kbps.  

The lesser the bitrates the lesser the quality of the audio and when we increase the bit rates, the quality of the audio recorded gradually increases.

Bitrates of 128 kbps give us a radio like quality whereas when we use bitrates of 320 kbps we get very good or CD-like quality.

According to the scenario, the most appropriate answer is option A.

digital video recorders​ (DVRs) in an inventory are known to be defective. What is the probability you randomly select an item that is not​ defective?

Answers

Answer:

76%

Explanation:

Based on the information provided within the question it can be said that in this scenario the probability you randomly select an item that is not​ defective would be 76%. This can be calculated in the following way:

50-12=38  (Number of recorders in working condition)

(38)/(50)=0.76

The probability is: 0.76

Now we times this decimal by 100 to get the percent.

0.76 * 100 = 76%

How can you create a document using a predefined table​

Answers

Click the file tab, and then click New. * Under available templates , click New from existing . * Click a template or a document that is similar to the one that you want to create, and then click create New

Fiona is drawing polygons on a computer. She wants to map a regular 9-sided polygon back onto itself using a reflection. Which set of lines can Fiona choose from for her line of reflection?. A) any line passing through the center of the polygonB) any perpendicular bisector of one of the sides

C) any line joining the midpoints of any two sides

D) any line parallel to a side of the polygon

Answers

The answer is "B) any perpendicular bisector of one of the sides".

We can define a line of reflection as the line in which a shape is reflected, or we can say that it is the mirror in which the shape is reflected. The line of reflection is the perpendicular bisector of any pair of corresponding points. If you want to join sets of corresponding points on the object and image, then the line of reflection will slice the lines framed down the middle.
The set of lines that Fiona can choose from for her line of reflection is B) any perpendicular bisector of one of the sides.