1/20
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Data loop by char
char c;
while (in.get(c))
{
}
Data loop by token
string word;
while (in >> word)
{
}
Data loop by line
string line;
while (getline(in , line)
{
}
Data loop by line and char
string line;
while (getline(in, line))
{
for (char c : line)
{
}
}
Data loop by line and token
string line;
istringstream lineStream;
string word;
while (getline(in, line))
{
lineStream.clear()
lineStream.str(line);
// Do once each line
while (lineStream >> word)
{
// Do once each token in the line
}
}
Data loop by token and char
string word;
while (in >> word)
{
// Do once each token
for (char c : word)
{
// Do once each character in the token
}
}
Which operator gets numbers from input?
A loop that runs once for every word
Data loop by token
A loop that runs once for every character
Data loop by line
A loop that runs once for every line
Data loop by line
A loop that runs once for every word, treating each line separately
Data loop by line and token
A loop that runs once for each character, treating each line separately
Data loop by line and char
A loop that runs once for each character, treating each word separately
Data loop by token and char
"Count the number of duplicate words on each line"
Data loop by line and token
"Count the number of repeated characters in each word"
Data loop by token and char
"Print out only the words that start with an F"
Data loop by token
"Find the average of the numbers"
Data loop by token
"Print only the words not between a '
Data loop by char
Data loop by two tokens
string word;
int n;
while (in >> word && in >> n)
{
}
Data loop by five tokens
string word;
int i, j;
double d;
char c;
while (in >> word && in >> i && in >> j && in >> d && in >> c)
{
}
"Print a person's name and score only if their score is higher than the previous person's"
Data loop by two tokens.