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
N76 [4]
3 years ago
10

Consider the following code segment.

Computers and Technology
1 answer:
m_a_m_a [10]3 years ago
8 0

Answer:

10 20                                                                                                                          

30 40                                                                                                                          

50 60

Explanation:

Given

The above code segment

Required

What is printed, if anything

To do this, we analyze the code line by line.

Line 1: The first line creates a 4 by 3 array named mat

Line 2: for (int[] row : mat) {  -> This creates row[] array which represents each row of array mat

Line 3: for (int j = 0; j < row.length; j += 2){ -> This iterates through the even indexed elements of the row array i.e. 0 and 2

Line 4: System.out.print(row[i] + " "); -> This prints the even indexed elements of the row array.

The even indexed elements are: 10, 20, 30, 40, 50 and 60

Line 5: System.out.println(); --> This prints a new line

You might be interested in
Which of the following color palettes for the BackColor and ForeColor properties contains colors that are guaranteed to be displ
Norma-Jean [14]

Answer: 1)System Palette

Explanation: System palette is kind of palette found in the system which contain the color values that is used by the display.This palette is also  drawing of the devices and applications.But the application don't get the direct access to the system palette rather logical palette permits it.

They work on the basis of the properties carried from the Back color and Fore color.Other palettes mention in the option is incorrect because these palettes don't work for the operating system's display .Thus the correct option is option(1).

8 0
3 years ago
Assume X and Y are indepndent. Assume that X has mean 10 and standard deviation 8. Assume Y has mean 12 and standard deviation 6
Vitek1552 [10]

Answer:

\sigma_z = 10

Explanation:

Given

\bar x = 10

\sigma_x = 8

\bar y = 12

\sigma_y = 6

z = x + y

Required

\sigma_z

This is calculated as:

\sigma_z = \sqrt{Var(x) + Var(y)}

Calculate Var(x)

We have:

Var(x) = \sigma_x^2

Var(x) = 8^2

Var(x) = 64

Calculate Var(y)

We have:

Var(y) = \sigma_y^2

Var(y) = 6^2

Var(y) = 36

So, we have:

\sigma_z = \sqrt{Var(x) + Var(y)}

\sigma_z = \sqrt{64 + 36}

\sigma_z = \sqrt{100}

\sigma_z = 10

6 0
3 years ago
Write a program that declares an array named myArray with 8 components of the type int. Initialize the array to 8 values that th
Savatey [412]

Answer:

#include <iostream>

using namespace std;

void filterEvens(int myArray[]) {

   for (int i = 0; i < 8; ++i) {

     if(myArray[i]%2==0){

         cout<<myArray[i]<<" ";

     }

  }

}

int main(){

   int myArray[8];

   for(int i =0;i<8;i++){

       cin>>myArray[i];

   }

   filterEvens(myArray);

   return 0;

}

Explanation:

The solution is provided in C++

#include <iostream>

using namespace std;

The function filerEvens is defined here

void filterEvens(int myArray[]) {

This iterates through the elements of the array

   for (int i = 0; i < 8; ++i) {

This checks if current element is an even number

     if(myArray[i]%2==0){

If yes, this prints the array element

         cout<<myArray[i]<<" ";

     }

  }

}

The main begins here

int main(){

This declares an integer array of 8 elements

   int myArray[8];

The following iteration allows input into the array

<em>    for(int i =0;i<8;i++){</em>

<em>        cin>>myArray[i];</em>

<em>    }</em>

This calls the defined function filter Evens

   filterEvens(myArray);

   return 0;

}

6 0
3 years ago
Someone may choose to own a car instead of leasing because:
ozzi
They dont want to be in debt 
6 0
3 years ago
Read 2 more answers
_________is an open-source operating system that controls the way a smart mobile device (a smartphone or tablet) works. It was c
ZanzabumX [31]
Chrome OS is an open source OS developed by Google.
8 0
3 years ago
Other questions:
  • Which of the following is important to do when downloading a game to your
    8·1 answer
  • Which statements describe molecules
    12·1 answer
  • PLEASE HELP
    14·2 answers
  • What does enterprise operating system mean?
    13·1 answer
  • (Analyze scores) Write a program that reads an unspecified number of scores and determines how many scores are above or equal to
    10·1 answer
  • 0 50 100 150 200 250 300 350 400 Shape Size These shapes are the correct 50 01 100 150 Pattern Reference If you don't have red,
    15·2 answers
  • How can presentation software be used in a
    10·2 answers
  • Add code to this loop, to pick up all of the radios, with only seven blocks.
    13·1 answer
  • What is sexual intercourse <br><br>​
    13·2 answers
  • What are the steps to view two different versions of the same document at once?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!