subject
Health, 05.11.2020 16:00 mbrisen7420

Three students, studying the use of arrays, presented the following statements.

I - The first student developed code 1 and concluded that his code makes use of

correct array and C ++ language.

#include <iostream>

using namespace std;

int main () {

int i, j, m [12] [12];

for (i = 0; i <12; i ++) {

for (j = 0; j <12; j ++) {

m [i] [j] = j% 2 - 1;

}

}

for (i = 0; i <12; i ++) {

for (j = 0; j <12; j ++) {

m [i] [j] = -1 - m [i] [j];

}

}

}

Code 1
II - The second student developed code 2 and concluded that his code does

correct use of arrays and the C ++ language.

#include <iostream>

using namespace std;

int main () {

double a [10] [5] = {{10}, {5}, {6}}, x [5] = {5}, b [10] = {1};

int i, j, m = 10, n = 5;

for (i = 0; i <m; i ++) {

b [i] = 10.0;

for (j = 0; j <n; j ++) {

b [i] = b [i] + a [i] [j] * x [j];

}

}

}

Code 2

III - The third student developed code 3 and concluded that his code makes use of

correct array and C ++ language. # include <iostream>

#include <iostream>

using namespace std;

const int N = 2;

int main () {

int i, j, k, a [N] [N] = {2,0,0,1}, b [N] [N] = {1,1,1,1}, c [N] [N] = {1,2,3,4};

for (i = 0; i <N; i ++) {

for (j = 0; j <N; j ++) {

c [i] [j] = 0;

for (k = 0; k <N; k ++) {

c [i] [j] + = a [i] [k] * b [k] [j];

}

}

}

}

Code 3
Check the correct alternative:

a) Only alternative I is true

b) Only alternative II is true

c) Alternatives I and II are true

d) Alternatives II and III are true

e) All statements are true

ansver
Answers: 2

Another question on Health

question
Health, 23.06.2019 13:00
Mason joined the water polo team at his school. as part of his conditioning, mason's coach requires a 25-minute run during practice. mason's heart rate reaches 125 beats per minute, but his target heart rate zone is 138—183 beats per minute. what should mason do to get the most benefit for his heart? increase the amount of time he runs increase the speed at which he runs decrease the amount of time he runs decrease the speed at which he runs
Answers: 1
question
Health, 23.06.2019 22:00
Why am i a lesbian? don't report plz
Answers: 2
question
Health, 24.06.2019 03:30
Witch action is most likely to continue an accident chain? a.changing the situation b.changing the unsafe habit c.changing the unsafe habit d.changing the result
Answers: 1
question
Health, 24.06.2019 07:00
What is an aed? where are they found?
Answers: 1
You know the right answer?
Three students, studying the use of arrays, presented the following statements.

I - The...
Questions
question
English, 30.01.2022 06:10
question
Mathematics, 30.01.2022 06:10
question
Mathematics, 30.01.2022 06:10
Questions on the website: 13722360