RE: SLC21 Week2 - Programming arrays

You are viewing a single comment's thread from:

SLC21 Week2 - Programming arrays

in slc21w2sergeyk •  10 days ago 
Task Comment Grade
1) Declare an array of any type: explain how to use an array, how to access array elements.Assign values ​​to some of its elements, and use those values ​​display) What are the advantages of an array over ordinary variables Basic concepts, array operations were well explained 1.4/1.5
2) What is **the name** of the array? What will happen if you display this value on the screen? What does `cout<&lta+2;`that mean (cout<&lta-2;)? If `cout<&lta;` displays 4,000, then how much will it be`a+1?` With regard to (a-2), it is possible just like crossing the road at a red light ((, but the result is both unpredictable and emergency. But you should not write something there a[-2]=9; but it can be done. Well, as if it is possible as a physical possibility and as a legal one 1.4/1.5
3) Can an array have two dimensions? 1/1
4) Write a random number in the variable k. `int k=(rand()%101) * (rand()%101) * (rand()%101)+500;` Try to solve the task of finding divisors from the last lesson more efficiently (so that the divisors are found faster) and write the results (not on the screen) but in an array. _Since the transfer of arrays to a function is not a simple topic - filling the array should not be done in the form of a function!!!_ The main point of this task (because it was in the previous lesson) is to find and explain why you should search BEFORE sqrt(n). You did it well, but since it is far from an obvious thing for most people, it would be even better to explain it in more detail. It's good that you sorted them, but if we talk about efficiency - was it worth sorting them, maybe it can be done somehow easier. Analyzing the array construction process (its structure) 1.9/2
5) Fill the array with 55 numbers with random numbers from 10 to 50. If there is a number 37 among the elements of the array, print it `yes`, and if there is no such number, print it `no` Well done, you demonstrate a search on different data in an array, showing both "yes" and "no" answers 1/1
6) Fill an array of 66 numbers with random numbers from 12 to 60. Replace even elements with 7 and odd elements with 77 The task seems to be simple to output the input array (randomly generated), but how do you check the program's accuracy. It is necessary to see the input data - and the result. 0.8/1
7) Fill the array of 77 numbers with random numbers from 102 to 707. Find the two largest numbers. But the phrase "the two largest numbers" can have many interpretations. Therefore, first explain well how this phrase was understood. And then solve the problem. You didn't just explain your understanding of what the "two largest" are, but even gave two explanations for it))) And then you give `max1`and `max2` the value -1, you can't do that, because there may be a situation when in arrays of numbers are less than -10, and then your largest will remain -1 In addition, there may be an option where all the numbers are the same. Then in this case why will be equal to the second largest 1.6/2
Total: 9.1/10
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!