C Chapter 12
Quiz yourself by thinking what should be in
each of the black spaces below before clicking
on it to display the answer.
Help!
|
|
||||
|---|---|---|---|---|---|
| In C++, you can use the ____ function to determine the number of character contained in a string variable. | length()
🗑
|
||||
| What is the syntax for the length function? | string.length()
🗑
|
||||
| In C++, you can use the ___ function to remove one or more characters located anywhere in a string variable. | erase()
🗑
|
||||
| In an erase function ___ refers to the unique number assigned to each character contained in the string variable; the number indicates the character position in the string. | Subscript
🗑
|
||||
| What is the syntax for the erase function? | string.erase(subscript[, count])
🗑
|
||||
| If you omit the ___ argument, the erase function removes all characters from the subscript position through the end of the string. | count
🗑
|
||||
| You can use the ___ function to access any number of characters contained in a string variable. | substr()
🗑
|
||||
| The arguments in a substr() function can be ___ or ___ | numeric literal contants, names of numeric variables.
🗑
|
||||
| In C++, you can use the __ function to insert characters within a string variable. | insert()
🗑
|
||||
| In C++ you can use the ___ function to search a string variable to determine whether it contains a specific sequence of characters. | find()
🗑
|
||||
| If the searchstring is found(in a find() function), the value will be greater than or equal to 0. TRUE/FALSE? | TRUE
🗑
|
||||
| If the searchstring is not found(in a find function), the value will be -1. TRUE/FALSE | TRUE
🗑
|
||||
| In C++, you can use the ___ function to compare a portion of a string variable's contents with another string. | compare()
🗑
|
||||
| What is the syntax for the compare() function? | string1.compare(subscript, count, string2)
🗑
|
||||
| In a compare() function, if the character you are searching for comes after the character you are comparing, a ___ will be displayed. | 1
🗑
|
||||
| In a comapre() function, if the character you are searching for comes before the character you are comparing, a ___ will be displayed. | -1
🗑
|
||||
| In a comapre() function, if the character you are searching for is equal to the character you are comparing, a ___ will be displayed. | 0
🗑
|
||||
| In C++, you can use the __ function to duplicate one character a specified number of times and assign the resulting string to a string variable. | assign()
🗑
|
||||
| What is the syntax for the assign() function? | string.assign(count, character)
🗑
|
||||
| Connecting(or linking) strings together is called ___. In C++, you do this by using the ___ ___. | concatenating, concatenation operator.
🗑
|
Review the information in the table. When you are ready to quiz yourself you can hide individual columns or the entire table. Then you can click on the empty cells to reveal the answer. Try to recall what will be displayed before clicking the empty cell.
To hide a column, click on the column name.
To hide the entire table, click on the "Hide All" button.
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.
To hide a column, click on the column name.
To hide the entire table, click on the "Hide All" button.
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.
Normal Size Small Size show me how
Normal Size Small Size show me how
Created by:
darkskye