Think Pair Share 20
- Due Apr 7, 2020 by 9am
- Points 1
- Submitting a file upload
- Available after Apr 6, 2020 at 9am
Consider the function below. Write a JavaDoc for it. It should be in the correct format and include a general overview and all necessary annotations.
string countOccurrences(string word, char c){
int count = 0;
// Count all the occurrences of the character c in word.
for(int i = 0; i < word.size(); i++){
if(word.at(i) == c){
count++;
}
}
return count;
}
Spend about 5 minutes on your own thinking through a solution without looking up any material and write it down either in an electronic document (Google Doc, Word, etc.) or on a piece of paper. After the 5 minutes is up, share what you have with your group members. If a revision is necessary, add it as a new section to your document or paper. Upload your document or an image of your paper to this Canvas assignment.
Please keep in mind that you will not be graded based on correctness but on effort. Trust me that it is more helpful in terms of knowledge retention for you to 1) not look at notes while doing the TPS and 2) only look at the solution after you have submitted.
After you have submitted, see this video for solutions Links to an external site..
Rubric
Criteria | Ratings | ||
---|---|---|---|
You uploaded a document or an image of a paper
|
|
||
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
|
|
||
|