principles of programming languages

4
JNTUWORLD Code No: T0521 II B.Tech II Semester, Supplementary Examinations, Nov/ Dec - 2011 PRINCIPLES OF PROGRAMMING LANGUAGES (Computer Science and Engineering) Time: 3 hours Max. Marks: 80 Answer any FIVE Questions All Questions carry equal marks 1. a) How can the knowledge of programming language characteristics benefit the computing community? b) Briefly explain the category of programming languages whose structure is dictated by the Von Neumann architecture. 2. a) What is meant by syntax and semantics of a language? Explain their importance in programming. b) Explain two mathematical models of language generation and recognition for language description. 3. a) Briefly explain enumeration and sub range data type. Do they belong to primitive data types or user defined data types? Justify. b) Explain pointers in C and C++ 4. a) Define a loop? how will you handle special cases in loops? b) What is the problem with nesting selectors? How various programming languages resolved the problem? 5. a) Define static binding and dynamic binding. Pascal supports both. Justify with suitable examples. b) Explain the characteristics of sub program. 6. a) What is friend function? What is friend class? b) How is Struct objects in C# created? Explain with examples. 7. a) Explain why prolog system must do backtracking. b) Explain control mechanism in PROLOG 8. a) Explain main features of imperative languages. b) Discuss the operations on atoms, operations of lists available in LISP. 1 of 1 SET - 1 R07 www.jntuworld.com www.jntuworld.com

Upload: saiteja1234

Post on 18-Sep-2015

217 views

Category:

Documents


1 download

DESCRIPTION

cxcxcxc

TRANSCRIPT

  • JNTUW

    ORLD

    Code No: T0521

    II B.Tech II Semester, Supplementary Examinations, Nov/ Dec - 2011

    PRINCIPLES OF PROGRAMMING LANGUAGES (Computer Science and Engineering)

    Time: 3 hours Max. Marks: 80 Answer any FIVE Questions

    All Questions carry equal marks

    1. a) How can the knowledge of programming language characteristics benefit the computing community? b) Briefly explain the category of programming languages whose structure is dictated by the Von Neumann architecture.

    2. a) What is meant by syntax and semantics of a language? Explain their importance in programming. b) Explain two mathematical models of language generation and recognition for language description.

    3. a) Briefly explain enumeration and sub range data type. Do they belong to primitive data types or user defined data types? Justify. b) Explain pointers in C and C++

    4. a) Define a loop? how will you handle special cases in loops? b) What is the problem with nesting selectors? How various programming languages resolved the problem?

    5. a) Define static binding and dynamic binding. Pascal supports both. Justify with suitable examples. b) Explain the characteristics of sub program.

    6. a) What is friend function? What is friend class? b) How is Struct objects in C# created? Explain with examples.

    7. a) Explain why prolog system must do backtracking. b) Explain control mechanism in PROLOG

    8. a) Explain main features of imperative languages. b) Discuss the operations on atoms, operations of lists available in LISP.

    1 of 1

    SET - 1 R07

    www.jntuworld.com

    www.jntuworld.com

  • JNTUW

    ORLD

    Code No: T0521

    II B.Tech II Semester, Supplementary Examinations, Nov/ Dec - 2011

    PRINCIPLES OF PROGRAMMING LANGUAGES (Computer Science and Engineering)

    Time: 3 hours Max. Marks: 80 Answer any FIVE Questions

    All Questions carry equal marks

    1. a) How can user defined operator overloading harm the readability of a program? b) Which produces faster program execution, a compiler or interpreter? List the

    advantages in implementing a language with a pure interpreter.

    2. a) Define CFG. State whether CFG is a language generator or recognizer. b) Explain Static and dynamic scope roles.

    3. a) What are the problems associated with using classes in Java for implementing enumeration types?

    b) Differentiate records from variant records with suitable examples

    4. a) What are pre conditions, invariants and post conditions? give their role in loops.. b) Explain with example how operand-evaluation order interacts with functional side

    effects.

    5. a) Briefly explain procedure declaration in pascal with examples. b) Distinguish between pass-by-value and pass-by reference.

    6. a) What is the reason java doesnt have friend functions or friend classes? b) Briefly Explain about different types of encapsulation constructs.

    7. a) Write a prolog program that returns a list containing the union of the elements of two given lists.

    b) Compare the concept of data typing in an ADA with that of prolog.

    8. a) Explain structures and arrays in ML give examples. b) Write a LISP function fib(n) that computes nth Fibonacci number.

    1 of 1

    SET - 2 R07

    www.jntuworld.com

    www.jntuworld.com

  • JNTUW

    ORLD

    Code No: T0521

    II B.Tech II Semester, Supplementary Examinations, Nov/ Dec - 2011

    PRINCIPLES OF PROGRAMMING LANGUAGES (Computer Science and Engineering)

    Time: 3 hours Max. Marks: 80 Answer any FIVE Questions

    All Questions carry equal marks

    1. a) What construct of a programming language provides process abstraction? b) List the fundamental features of an object oriented programming language.

    2. a) What are different methods for semantic description? Explain with examples. b) What are the difficulties in using an attribute grammar to describe all of the syntax and static semantics of a contemporary programming language?

    3. a) How will you allocate static variables at compile time? b) What are the advantages of user-defined data types?

    4. a) What are the advantages and disadvantages of allowing mixed-mode arithmetic expressions? b) Discuss in detail overloaded operators.

    5. a) Explain the general subprogram characteristics.. b) Differentiate between pass-by-result and pass-by-value-result.

    6. a) What is the relationship of monitors to Ada tasks for competition synchronization? b) Explain how semaphores can be used to achieve mutual exclusion.

    7. a) What are Exceptions? How they are handled in ML?. b) What are the three forms of prolog term?

    8. a) Discuss the operations on atoms, operations of lists available in LISP. b) Discuss briefly about expressions in ML

    1 of 1

    SET - 3 R07

    www.jntuworld.com

    www.jntuworld.com

  • JNTUW

    ORLD

    Code No: T0521

    II B.Tech II Semester, Supplementary Examinations, Nov/ Dec - 2011

    PRINCIPLES OF PROGRAMMING LANGUAGES (Computer Science and Engineering)

    Time: 3 hours Max. Marks: 80 Answer any FIVE Questions

    All Questions carry equal marks

    1. a) Why is type checking the parameters of a subprogram are important? b) Discuss the general methods of implementing a programming language.

    2. a) In what fundamental way do operational semantics and denotational semantics differ? b) Explain with an example how operator associativity can be incorporated in

    grammars.

    3. a) Write short notes on integer and floating point numbers in programming languages. What are the problems associated with storing floating point numbers in binary?

    b) Define strong typing. Discuss how type checking is enforced in Fortran 95, Ada, C, C++, and Java. What do you mean by coercion, how does it effect strongly typed languages?

    4. a) How does C support relational and Boolean expressions? b) Explain in detail guarded commands.

    5. a) Discuss about actual parameters, positional parameters and keyword parameters. b) Explain the design issues of subprogram.

    6. a) Explain the relative safety of cooperation synchronization using semaphores and using Adas classes in task?

    b) What do you mean by Data Abstraction? How data abstraction is achieved in C++

    7. a) Explain how backtracking works in prolog. b) Describe the exception handling in C++.

    8. a) Briefly explain the characteristics of functional programming languages. b) List the standard predicates available in most LISP implementation.

    1 of 1

    SET - 4 R07

    www.jntuworld.com

    www.jntuworld.com