Quiz
Final prep Theory (3210)
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (13)
1When implementing a compiler for a programming language, regular expression is used to specify
- AToken name
- BToken pattern
- CIdentifier
- DContext free grammar
2When designing a programming language, context free grammar (or BNF) is used to specify
- ARegular expression
- BLanguage syntax
- CLanguage semantics
- DProgram
- EToken pattern
3Which of the following criteria is not appropriate to evaluate a programming language?
- AReadability
- BWritability
- CReliability
- DCost
- ENone of the above
4A CFG is ambiguous if
- AThere is a sentence such that no parse tree can be constructed from the CFG
- BThere is a sentence such that one parse tree can be constructed from the CFG
- CThere is a sentence such that two or more parse trees can be constructed from the CFG
- DNone of the above
5A program has syntax error(s) if
- Ano parse tree for the program can be constructed from the CFG
- Bone parse tree for the program can be constructed from the CFG
- Ctwo or more parse trees can be constructed from the CFG
- Dnone of the above
6The functions int sum( int aArray[]. int size); and __________ are NOT overloaded functions
- Afloat sum(float aArray[]. int size);
- Bint sum(int size, int aArray[]);
- Cfloat sum(int aArray[], int size);
- Dvoid sum(int oneArray[]. int arraySize, int& result);
7Which of the functions will be invoked by the statement f(10.5,10);
- Afloat f(int x, int y=10);
- Bint f(double x, double y);
- Cfloat f(double x, int y, int z = 10);
- Dvoid f(int x, int y, double z = 10.0);
8Which of the following function declarations follows Java syntax?
- AAre local variables statically or dynamically allocated?
- BCan subprograms be generic?
- CCan subprograms be overloaded?
- DCan subprograms be overrided?
9Which of the following is a legal rule or fact in Prolog?
- ARaining(Today).
- Braining(today).
- CRaining.
- DRaining(Today) :- not(sunny(Today)),not(cloudy(Today)).
10Which of the following is NOT a correct representation of a list in Prolog?
- A[a, b, c]
- B[a, "b", 2]
- C[a | [] ]
- D[a | [a | [b, c] ] ]
- E[a, [a, c]]
- FNone of the above
11What's the value of dynamic link in an activation record instance?
- AThe address of the activation record instance of its caller
- BThe address of the most recent activation record instance of its static parent
- CThe address of the activation record instance of itself
- DThe address of the activation record instance of main function
12What's the value of static link in an activation record instance?
- AThe address of the activation record instance of its caller
- BThe address of the most recent activation record instance of its static parent
- CThe address of the activation record instance of itself
- DThe address of the activation record instance of main function
13Which of the following is false?
- AAn activation record instance is created for each function.
- BThe activation record format is static, but its size may be dynamic
- CAn activation record instance is dynamically created when a subprogram is called
- DActivation record instances reside on the run-time stack
Information
- Description
- Computer Science Quiz on Final prep Theory (3210), created by Austin Stockhecke on 02/05/2018.
- Author
- Austin Stockhecke
- Language
- English
- Views
- 1
- Tags
- Rating
- No ratings yet Rate this quiz