Think Pair Share 13
- Due Oct 15, 2020 by 10am
- Points 1
- Submitting a file upload
- Available after Oct 14, 2020 at 10am
Think
Insert a new row just below the header in the table in your TPS Google Doc. Fill in the first two columns. Place your response to the following in the "Think" column:
Consider the following code that creates a string called nameA, copies it to a new string called nameB, then modifies nameB by down casing its first letter, and prints them both out:
string nameA = "Billy";
string nameB = nameA;
nameB[0] = tolower(nameB[0]);
cout << nameA << " -- " << nameB <<endl;
This produces the following output:
Billy -- billy
How do we need to adapt this program to use C-strings (char arrays) for nameA and nameB? We can't just change the declarations as follows; that won't complile:
char nameA[] = "Billy";
char nameB[] = nameA;
nameB[0] = tolower(nameB[0]);
cout << nameA << " -- " << nameB <<endl;
Pair
If you are joining the class live (in person or over Zoom), pair up with someone when asked to do so—please use Discord or your preferred means of interacting with someone to share your answers (please see the announcement with details about Discord). Settle on an answer between to two or three of you and put that answer down in your "Pair" column.
Share
Regardless of whether or not you are attending live, one person from your pair group should add your answer to the "TPS class share Links to an external site." document.
Submit
Finally, submit your personal TPS Google doc to this assignment.
Rubric
Criteria | Ratings | ||
---|---|---|---|
You uploaded your copy of the TPS Google doc
|
|
||
You made a reasonable attempt at the "thinking" portion and this was clearly marked on your document
|
|
||
You made a reasonable attempt at the "sharing" portion and this was clearly marked on your document
|
|
||
|