RE: SLC21 Week3 - Strings in C

You are viewing a single comment's thread from:

SLC21 Week3 - Strings in C

in slc21w3sergeyk •  6 days ago 
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. On the one hand, you write about not using string functions, and then you use them 2.3/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&lt&lts; => FEDCBA I see here that a line shift is accidentally opened))) there is a mention that we are moving to the middle, but why only to the middle? 0.9/1
Swap neighboring letters char s[]="ABCDEF";.....your code.....cout&lt&lts; => BADCFE you don't explain why the cycle is executed 1 step less, and you weakly and vaguely explain the rest 'i = 0 => s[0] = s[1] ( A = B)' what is that? 0.7/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&lt&lts&lt&lt"\n"&lt&ltx; => BCDEFA aabrakadabr the text I submitted was an example, you should have moved your own lines. While solving the line flip problem, I think you accidentally opened a line shift. And here you give another effective way of shifting. It would be great to explain and contrast/compare these two methods. 1.1/1.5
Remove all vowel letters char s[]="this is some text";...your code...cout&lt&lts; => ths s sm txt since the string size is reduced it does not lead to memory problems. 1.1/1.5
Double each vowel letter char s[]="this is some text";...your code...cout&lt&lts; => thiis iis soomee teext When you did not initially specify the size in line #9, the compiler issued an error, why demonstrate it if you do not write about the error and do not ask for advice here. Is the output normal? The other time you specified the size for an empty output array, everything worked. If you increased the size of the original and the cut, specified a larger size for the line - it would be possible to perform this task without an additional array 1.2/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&lts&ltss; => (this is some text) len of s => 17 number =27 ---
Total: 7.3/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!