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 | A good illustration of working with an array - instructions for beginners | 1.5/1.5 |
2) What is **the name** of the array? What will happen if you display this value on the screen? What does `cout<<a+2;`that mean (cout<<a-2;)? If `cout<<a;` displays 4,000, then how much will it be`a+1?` | Pretty comprehensive explanation, okay | 1.5/1.5 |
3) Can an array have two dimensions? | Here is a translation error, I did not mean dimensions , but sizes(two sizeof one-dimensional). | 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 was to explain why searches should be carried out to sqrt(n), you did a good job. And the array could be ordered, not by general sorting methods, but by using the features of this array | 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` | Yes, here it was necessary to find the fact of the existence of a certain number, but most beginners make a verdict for each element - nnnnnnynynynynny | 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 | Great, for some reason everyone forgot to output the input array | 1/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. | The two largest elements should have been searched for in the general case, this filling is only an imitation of unknown data. I understood that you assumed that the minimum that can be an array is 102. But the program should always be divided into functionally independent separate parts. One part fills the array, the other function looks for the two largest. In addition, the idea of sorting, of course, has a place as one of the ideas, but it takes a long time to sort. And besides, in the sorted array {.......45.45,,77,77,77}, what are the last two values {77,77} or {45, 77}? That's why I gave the task at the beginning to explain the understanding of what "the two biggest" means. Overall, this is a very complete and detailed answer, and homework is the best | 1.8/2 |
Total: | Thank you, very good work! | 9.7/10 |
RE: SLC21 Week2 - Programming arrays
You are viewing a single comment's thread from:
SLC21 Week2 - Programming arrays
Thank you :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit