Task | Comment | Grade |
---|---|---|
Practically (i.e., with code examples) explain the theory from the first part of this lesson, where the concept of two sizes of an array is discussed. Demonstrate how to make it look like the array size can be increased/decreased. All loops should work with the array size stored in the size variable. Keep the physical, actual size in the constant N. | Very succinctly but fully and nicely explained how you can "change" the size of arrays. It should be noted that with such addition/deletion, the real size of the array should be controlled | 2.8/3 |
Declare a string variable (store any sentence in the array). Task: reverse the string, i.e., write it backward. For example: char s[]="ABCDEF";.....your code.....cout<<s; => FEDCBA | It was worth emphasizing and explaining why we are considering only half of the massif. Many process the entire array in this task | 0.8/1 |
Swap neighboring letters char s[]="ABCDEF";.....your code.....cout<<s; => BADCFE | Here it is explained that we process the array in step two, but why we do not go through 100% of the array, why we do not scan the array to the end | 0.8/1 |
Shift the string cyclically to the left (it’s easier to start with this), then cyclically to the right. char s[]="ABCDEF", x[]="abrakadabra";.....your code.....cout<<s<<"\n"<<x; => BCDEFA aabrakadabr | The essence of the task was to implement the shift, to repeat my text data, and to shift both lines - that's unnecessary. In addition, the output of the program does not correspond to the code, if you sequentially shift to the left, then to the right - the data will not change. And the output of the program shows only a shift to the left. If you do it sequentially, you should have also demonstrated the result of the work after shifting to the left. | 1/1.5 |
Remove all vowel letters char s[]="this is some text";...your code...cout<<s; => ths s sm txt | In the examples, I show that the string s is declared, we shift the string s, and output the contents of the string s. Building another string according to the conditions of the task is good, but it is a little easier and a different task than I gave. (its simplified variation) | 1/1.5 |
Double each vowel letter char s[]="this is some text";...your code...cout<<s; => thiis iis soomee teext | The same remark as the previous one, building another line and then copying it is a simplified task. Especially since I indicated to work with the array as an array of symbols, and not to use library functions | 1.3/2 |
аAdditional task (1-2 points) - as a replacement for any of the tasks 2-6: Choose any number, preferably slightly larger than the length of the text. Increase the text length to the specified number by adding spaces between words. char s[]="this is some text";...your code...cout<s<ss; => (this is some text) len of s => 17 number =27 | This extra task should have been done instead of some other one of your choice. Since this task is more difficult, I will add points to the penultimate task | 0.5 |
Total: | 8.2/10 |
RE: SLC21 Week3 - Strings in C
You are viewing a single comment's thread from:
SLC21 Week3 - Strings in C