Programming > EXAM > Arizona State UniversityCSE 340Final Exam_ Principles of Programming Languages (All)

Arizona State UniversityCSE 340Final Exam_ Principles of Programming Languages

Document Content and Description Below

1/16/2020 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 Avail... able 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. Ques 1 / 1 pts tion 1 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 0 1 2 Correct! 3 Q 1 / 1 pts uestion 2 letter = a | b | c | d LETTER = A | B | C | D 1/16/2020 Final Exam: Principles of Programming Languages https://asuce.instructure.com/courses/1344/quizzes/17553?module_item_id=119038 2/20 digit = 4 | 5 | 6 | 7 | 9 Consider the regular expression R = (LETTER | digit | !) • (letter • digit) • (letter | digit). Which of the following is correct (more than one choice or no choice can be correct)? 1 * !5aA ∈ L(R1) ?55aA ∈ L(R1 ) 555aA ∈ L(R1 ) None of the above Correct! Ques 1 / 1 pts tion 3 Consider the regular expressions: R = ( a | b )* ( 0*1* ) ( a | b )* R = ( a | b ) ( 0*1* )* ( a | b ) Which of the following is true? 1 2 a0a ∈ L(R1) and ab01a ∈ L(R2) a0a ∈ L(R1) and ab01a ∉ L(R2) Correct! a0a ∉ L(R1) and ab01a ∈ L(R2) a0a ∉ L(R1) and ab01a ∉ L(R2) [Show More]

Last updated: 1 year ago

Preview 1 out of 20 pages

Reviews( 0 )

$10.00

Add to cart

Instant download

Can't find what you want? Try our AI powered Search

OR

GET ASSIGNMENT HELP
88
0

Document information


Connected school, study & course


About the document


Uploaded On

Jun 12, 2022

Number of pages

20

Written in

Seller


seller-icon
AGRADES

Member since 3 years

8 Documents Sold


Additional information

This document has been written for:

Uploaded

Jun 12, 2022

Downloads

 0

Views

 88

Document Keyword Tags

Recommended For You


$10.00
What is Browsegrades

In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Browsegrades · High quality services·