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
Sever21 [200]
3 years ago
12

Consider the following code segment.

Computers and Technology
1 answer:
Fynjy0 [20]3 years ago
6 0

Answer:

C

Explanation:

10 15 20 35

30 35 40 45

50 55 60 65

You might be interested in
__________ has the highest conviction rate of any vehicle-related offense.
loris [4]

Answer:

Speeding

Explanation:

Excessive speeding has the highest conviction rate of any vehicle-related offense. It is often said that "speed thrills but kills." This statement is true. A cautious driver should always check for speed signs and always play by the rules. Speeding will not only get you a ticket but also will cause fatal accidents or collisions that might lead to injury or death. Speeding offenses include fines, points reduction, or court hearing.

6 0
3 years ago
Write two recursive versions of the function minInArray. The function will be given a sequence of elements and should return the
Tomtit [17]

Answer:

Following are the code to this question:

#include <iostream>//defining header file

using namespace std;//using namespace

int minInArray1(int arr[],int arrSize)//declaring method minInArray1

{

if(arrSize == 1)//use if block to check arrSize value is equal to 1  

{

return arr[0];//return first element of array

}

else //defining else block

{

int max= minInArray1(arr, arrSize-1);//use integer variable max to call method recursively  

if(arr[arrSize-1] < max)//use if block to check array value  

{

max = arr[arrSize-1];//use max to hold array value

}

return max;//return max variable value

}

}

int minInArray2(int arr[], int low, int high)//defining a method minInArray2  

{

if(low == high) //use if to check low and high variable value are equal

{

return arr[low];//return low variable value

}

else //defining else block

{

int minimum = minInArray2(arr, low+1, high);//defining integer variable minimum to call method minInArray2 recursively

if(arr[low] < minimum)

{

minimum = arr[low];//use minimum variable to hold array value

}

return minimum;//return minimum value

}

}

int main()//defining main method

{

int arr[10] = { 9, -2, 14, 12, 3, 6, 2, 1, -9, 15 };//defining an array arr

int r1, r2, r3, r4;//defining integer variable

r1 = minInArray1(arr, 10);//use r1 variable to call minInArray1 and hold its return value

r2 = minInArray2(arr, 0, 9);//use r1 variable to call minInArray2 and hold its return value

cout << r1 << " " << r2 << endl; //use print method to print r1 and r2 variable value

r3 = minInArray2(arr, 2, 5);//use r3 variable to call minInArray1 and hold its return value

r4 = minInArray1(arr + 2, 4); //use r4 variable to call minInArray2 and hold its return value

cout<<r3<< " " <<r4<<endl; //use print method to print r3 and r4 variable value

return 0;

}

Output:

please find the attached file.

Explanation:

In the given code two methods, "minInArray1 and minInArray2" is defined,  in the "minInArray1" it accepts two-variable "array and arrSize" as the parameter, and in the "minInArray2" method it accepts three integer variable "array, low, and high" as the parameter.

  • In the "minInArray1" method, and if the block it checks array size value equal to 1 if the condition is true it will return the first element of the array, and in the else block the max variable is defined, that calling method recursively
  • and store its value.
  • In the "minInArray2" method, an if the block it checks low and high variable value is equal. if the condition is true it will return a low array value. In the next step, the minimum value is defined, which checks the element of the array and uses a low array to store its value.
  • In the main method an array and four integer variable "r1, r2, r3, and r4" is defined, which calls two methods "minInArray1 and minInArray2" and use print method to print its value.
3 0
3 years ago
What method of heat transfer is used when the sun heats the earth?
monitta
Radiation is when heat travels through space.
8 0
4 years ago
Allison, a very close friend of yours, is about to give a presentation to the class. You know that she has procrastinated and is
Contact [7]

C is the right thing to do.

4 0
4 years ago
Read 2 more answers
Can someone please do this java lab for me (100 point version)?
nalin [4]

Answer:

.........................................sorry, dude I download the doc but ,I can't open it.

5 0
3 years ago
Other questions:
  • How do you activate caps lock on chromebook
    10·2 answers
  • What technology will examine the current state of a network device before allowing it can to connect to the network and force an
    7·1 answer
  • "what type of index has an index key value that points to a data row, which contains the key value? "
    9·1 answer
  • If brake fluid boils:
    11·2 answers
  • Which of the following is a hardware component used to hold the BitLocker encryption key and ensures encrypted data is not acces
    5·1 answer
  • How do i make a profile picture <br> REALLY URGENT I NEED IT NOW!!!
    8·2 answers
  • Determine the number of character comparisons made by the brute-force algorithm in searching for the pattern GANDHI in the text
    7·1 answer
  • In java language I want the code
    15·1 answer
  • An Accenture healthcare client is interested in implementing an Artificial Intelligence (AI) solution to improve patient care, b
    11·1 answer
  • A data analyst uses _____ to decide which data is relevant to their analysis and which data types and variables are appropriate
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!