Final Exam: Principles of Programming Languageshttps://asuce.instructure.com/courses/1344/quizzes/17553?module_item_id=119038 1/20Final ExamDue No due date Points 40 Questions 40 Available Jan 13 at 12am - Dec 31, 2023 at 11:59pm almost 4 yearsTime Limit NoneAttempt HistoryAttempt Time ScoreLATEST Attempt 1 97 minutes 27.57 out of 40Score for this quiz: 27.57 out of 40Submitted Jan 16 at 12:19pmTh
...[Show More]
Final Exam: Principles of Programming Languages
https://asuce.instructure.com/courses/1344/quizzes/17553?module_item_id=119038 1/20
Final Exam
Due No due date Points 40 Questions 40 Available Jan 13 at 12am - Dec 31, 2023 at 11:59pm almost 4 years
Time Limit None
Attempt History
Attempt Time Score
LATEST Attempt 1 97 minutes 27.57 out of 40
Score for this quiz: 27.57 out of 40
Submitted Jan 16 at 12:19pm
This attempt took 97 minutes.
Question 1 1 / 1 pts
Consider the following code:
Token LexicalAnalyzer::GetToken()
{
input.GetChar(c);
switch (c) {
case '=':
input.GetChar(c);
if (c == ’=') {
tmp.token_type = EQEQ;
} else if (c == ’<') {
tmp.token_type = EQLT;
} else if (c == ’>') {
tmp.token_type = EQGT;
} else
tmp.token_type = ERROR;
return tmp;
default:
tmp.token_type = ERROR;
return tmp;
}
}
In the code, input.GetChar() gets the next character from standard input. If GetToken() is called four times on input <==<==,
how many times is ERROR returned
[Show Less]