All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
concepts of programming languages
Questions and Answers of
Concepts of Programming Languages
Explain the generate-and-test programming strategy in Prolog.
Explain the closed-world assumption used by Prolog. Why is this a limitation?
Explain the negation problem with Prolog. Why is this a limitation?
Explain the connection between automatic theorem proving and Prolog’s inferencing process.
Explain why Prolog systems must do backtracking.
What is the relationship between resolution and unification in Prolog?
Modify the C++ class for the abstract stack type shown in Section 11.4.2 to use a linked list representation and test it with the same code thatappears in this chapter.C++ class for abstract stack
What are the advantages of the two parts of the definition of abstract data type?
Design a queue abstract data type for float elements in a language that you know, including operations for enqueue, dequeue, and empty. The dequeue operation removes the element and returns its value.
Define abstract data type.
Some software engineers believe that all imported entities should be qualified by the name of the exporting program unit. Do you agree? Support your answer.
Design an abstract data type for a matrix with integer elements in a language that you know, including operations for addition, subtraction, and matrix multiplication.
What are the two kinds of abstractions in programming languages?
Compare the efficiency of the deep-access method to that of the shallow-access method, in terms of both calls and nonlocal accesses.
What are the two differences between the deep-access method for nonlocal access in dynamic-scoped languages and the static-chain method for static-scoped languages?
Describe the shallow-access method of implementing dynamic scoping.
Describe the deep-access method of implementing dynamic scoping.
Explain the two methods of implementing blocks.
What are the two potential problems with the static-chain method?
Name three widely used programming languages that do not allow nested subprograms.
Examine the subprogram call instructions of three different architectures, including at least one CISC machine and one RISC machine, and write a short comparison of their capabilities. (The design of
How are references to variables represented in the static-chain method?
What is an EP, and what is its purpose?
Design a skeletal program and a calling sequence that results in an activation record instance in which the static and dynamic links point to different activation-recorded instances in the run-time
Define static chain, static_depth, nesting_depth, and chain_offset.
The static-chain method could be expanded slightly by using two static links in each activation record instance where the second points to the static grandparent activation record instance. How would
What are the two steps in locating a nonlocal variable in a static-scoped language with stack-dynamic local variables and nested subprograms?
Pascal allows gotos with nonlocal targets. How could such statements be handled if static chains were used for nonlocal variable access?
What kind of machines often use registers to pass parameters?
Why are the return address, dynamic link, and parameters placed in the bottom of the activation record?
It is stated in this chapter that when nonlocal variables are accessed in a dynamic-scoped language using the dynamic chain, variable names must be stored in the activation records with the values.
What is the difference between an activation record and an activation record instance?
Although local variables in Java methods are dynamically allocated at the beginning of each activation, under what circumstances could the value of a local variable in a particular activation retain
What are the two reasons why implementing subprograms with stack-dynamic local variables is more difficult than implementing simple subprograms?
Assume that the program of Problem 4 is implemented using the shallow-access method using a stack for each variable name. Show the stacks for the time of the execution of fun3, assuming execution
What is the task of a linker?
Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in the following skeletal program. This program uses the deep-access method
What must be stored for the linkage to a subprogram?
Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in the following skeletal program. Assume bigsub is at level 1.The calling
Which of the caller or callee saves execution status information?
Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in the following skeletal program. Assume bigsub is at level 1. function
What is the definition used in this chapter for “simple” subprograms?
Write a program that includes two subprograms, one that takes a single parameter and performs some simple operation on that parameter and one that takes 20 parameters and uses all of the parameters,
Write three functions in C or C++: one that declares a large array statically, one that declares the same large array on the stack, and one that creates the same large array from the heap. Call each
Explain how the coercion rules of a language affect its error detection.
What two languages include multiple assignments?
What is the main reason user-located loop control statements were invented?
In what fundamental ways do the generic parameters to a Java 5.0 generic method differ from those of C++ methods?
If a Java 5.0 method returns a generic type, what type of object is actually returned?
If a Java 5.0 generic method is called with three different generic parameters, how many versions of the method will be generated by the compiler?
What are the design issues for functions?
What two languages allow multiple values to be returned from a function?
What exactly is a delegate?
What is the main drawback of generic functions in F#?
What is a closure?
What are the language characteristics that make closures useful?
What languages allow the user to overload operators?
In what ways are coroutines different from conventional subprograms?
What is parametric polymorphism?
What is an overloaded subprogram?
Define shallow and deep binding for referencing environments of subprograms that have been passed as parameters.
What are the two issues that arise when subprogram names are parameters?
What is the name of the parameter-passing method used in Ruby?
Describe the problem of passing multidimensioned arrays as parameters.
What are two fundamental design considerations for parameter-passing methods?
What is the difference between the way original C and C89 deal with an actual parameter whose type is not identical to that of the corresponding formal parameter?
Describe the ways that aliases can occur with pass-by-reference parameters.
Write a detailed comparison of the generic subprograms of Java 5.0 and C# 2005.
What are the modes, the conceptual models of transfer, the advantages, and the disadvantages of pass-by-value, pass-by-result, pass-by-value-result, and pass-by-reference parameter-passing methods?
What are at least two arguments against the use of pass-by-name parameters?
What are the three semantics models of parameter passing?
Speculate on the issue of allowing nested subprograms in programming languages—why are they not allowed in many contemporary languages?
What languages allow subprogram definitions to be nested?
Study the iterator mechanisms of Ruby and CLU and list their similarities and differences.
What are the advantages and disadvantages of static local variables?
Research Jensen’s Device, which was a use of pass-by-name parameters, and write a short description of what it is and how it can be used.
What are the advantages and disadvantages of dynamic local variables?
C# supports out-mode parameters, but neither Java nor C++ does. Explain the difference.
What are the design issues for subprograms?
Study the methods of user-defined operator overloading in C++ and Ada, and write a report comparing the two using our criteria for evaluating languages.
What are the differences between a function and a procedure?
Devise a subprogram and calling code in which pass-by-reference and pass-by-value-result of one or more parameters produces different results.
From a textbook on Fortran, learn the syntax and semantics of statement functions. Justify their existence in Fortran.
What are the advantages and disadvantages of keyword parameters?
Write a generic C++ function that takes an array of generic elements and a scalar of the same type as the array elements. The type of the array elements and the scalar is the generic parameter. The
Argue against the C design of providing only function subprograms.
What are formal parameters? What are actual parameters?
Write a program, using the syntax of whatever language you like, that produces different behavior depending on whether pass- by-reference or pass-by-value-result is used in its parameter passing.
Consider the following program written in C syntax:For each of the following parameter-passing methods, what are the values of the list array after execution?a. Passed by valueb. Passed by
What is a parameter profile? What is a subprogram protocol?
Write a C# program that includes two methods that are called a large number of times. Both methods are passed a large array, one by value and one by reference. Compare the times required to call
Present one argument against providing both static and dynamic local variables in subprograms.
What is a Ruby array formal parameter?
Write a program in some language that has both static and stack-dynamic local variables in subprograms. Create six large (at least 100 * 100) matrices in the subprogram—three static and three stack
Consider the following program written in C syntax:For each of the following parameter- passing methods, what are all of the values of the variables value and list after each of the three calls to
What languages allow a variable number of parameters?
Repeat Programming Exercise 3 in C#.Data From Exercise 3:Write a Perl program that passes by reference a literal to a subprogram, which attempts to change the parameter. Given the overall design
Suppose you want to write a method that prints a heading on a new output page, along with a page number that is 1 in the first activation and that increases by 1 with each subsequent activation. Can
What characteristic of Python subprograms sets them apart from those of other languages?
Write a Perl program that passes by reference a literal to a subprogram, which attempts to change the parameter. Given the overall design philosophy of Perl, explain the results.
Showing 400 - 500
of 965
1
2
3
4
5
6
7
8
9
10