Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Let s1, s2, and s3 be defined string objects. (a) Write statements that will ini

ID: 3528065 • Letter: L

Question

Let s1, s2, and s3 be defined string objects. (a) Write statements that will initialize both s1 and s2 to the empty string. (b) Suppose the statement cin >> s1; is executed and the user types Skwisgaar Skwigelf and presses the enter key. What will be stored in s1? (c) Suppose s1 and s2 have been assigned "Nathan" and "Explosion", respectively. Consider the statement s3 = s1 + s2; The symbol + in this context is called the string_____________(2 words). (d) What would be assigned to s3?

Explanation / Answer

string s1,s2,s3; a) s1=""; s2=""; b) SkwisgaarSkwigelf because cin>> command does not take space c) + is called concatination s3=Nathan Explosion