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
What operator usually has right associativity?
Would it be a good idea to eliminate all operator precedence rules and require parentheses to show the desired precedence in expressions? Why or why not?
Write a Java program that exposes Java’s rule for operand evaluation order when one of the operands is a method call.
What is a prefix operator?
Do you think the elimination of overloaded operators in your favorite language would be beneficial? Why or why not?
Write a test program in your favorite language that determines and outputs the precedence and associativity of its arithmetic and Boolean operators.
What is a ternary operator?
State your own arguments for and against allowing mixed-mode arithmetic expressions.
Rewrite the program of Programming Exercise 1 in C++, Java, and C#, run them, and compare the results.Data from Programming Exercise 1Run the code given in Problem 13 (in the Problem Set) on some
Define operator precedence and operator associativity.
When might you want the compiler to ignore type differences in an expression?
Run the code given in Problem 13 (in the Problem Set) on some system that supports C to determine the values of sum1 and sum2. Explain the results.Data from Problem 13:Suppose fun is used in a
What set operation models C’s struct data type?
For what types does C use structure type equivalence?
What is the primary disadvantage to structure type equivalence?
What is the primary advantage of name type equivalence?
What is structure type equivalence?
What is name type equivalence?
Why are C and C++ not strongly typed?
What languages have no type coercions?
What is a nonconverting cast?
Why is Java not strongly typed?
Define strongly typed.
Define type error.
What is a compatible type?
Why wouldn’t arithmetic on Java and C# references make sense?
Describe the lazy and eager approaches to reclaiming garbage.
What advantages do Java and C# reference type variables have over the pointers in other languages?
Why are reference variables in C++ better than pointers for formal parameters?
What is a C++ reference type, and what is its common use?
Why are the pointers of most languages restricted to pointing at a single type variable?
What are the two common problems with pointers?
What are the design issues for pointer types?
Are the unions of F# discriminated?
Define union, free union, and discriminated union.
On what are Python’s list comprehensions based?
In what way does Scheme’s CDR function modify its parameter?
What is the action of the F# function tl?
What is the action of the Scheme function CAR?
In what primarily imperative language do lists serve as arrays?
What is the purpose of an F# tuple pattern?
Are the tuples of Python mutable?
Explain how coercion rules can weaken the beneficial effect of strong typing.
What is the primary difference between a record and a tuple?
In what way is static type checking better than dynamic type checking?
Define fully qualified and elliptical references to fields in records.
Look up the definition of strongly typed as given in Gehani (1983) and compare it with the definition given in this chapter. How do they differ?
What is the purpose of level numbers in COBOL records?
What is the structure of an associative array?
What are the required entries in a Java array descriptor, and when must they be stored (at compile time or run time)?
What would you expect to be the level of use of pointers in C#? How often will they be used when it is not absolutely necessary?
What is an access function for an array?
What are the arguments for the inclusion of enumeration types in C#, although they were not in the first few versions of Java?
Define row major order and column major order.
What are the arguments for and against Java’s implicit heap storage recovery, when compared with the explicit heap storage recovery required in C++? Consider real-time systems.
What is an aggregate constant?
Write a short discussion of what was lost and what was gained in Java’s designers’ decision to not include the pointers of C++.
What languages support array slices with stepsizes?
Analyze and write a comparison of using C++ pointers and Java reference variables to refer to fixed heap- dynamic variables. Use safety and convenience as the primary considerations in the comparison.
What languages support negative subscripts?
Analyze and write a comparison of C’s malloc and free functions with C++’s new and delete operators. Use safety as the primary consideration in the comparison.
How does JavaScript support sparse arrays?
For what types of A and B is the simple assignment statement A = B legal in C++ but not Java?
In the Burroughs Extended ALGOL language, matrices are stored as a single-dimensioned array of pointers to the rows of the matrix, which are treated as single-dimensioned arrays of values. What are
What happens when a nonexistent element of an array is referenced in Perl?
Write a program in the language of your choice that behaves differently if the language used name equivalence than if it used structural equivalence.
Multidimensional arrays can be stored in row major order, as in C++, or in column major order, as in Fortran. Develop the access functions for both of these arrangements for three-dimensional arrays.
Define static, fixed stack-dynamic, fixed heap-dynamic, and heap-dynamic arrays. What are the advantages of each?
Write a Perl program that uses a hash and a large number of operations on the hash. For example, the hash could store people’s names and their ages. A random- number generator could be used to
What are all of the differences between the enumeration types of C++ and those of Java?
What are the design issues for arrays?
Write a C program that does a large number of references to elements of two- dimensioned arrays, using only subscripting. Write a second program that does the same operations but uses pointers and
What significant justification is there for the -> operator in C and C++?
In what ways are the user-defined enumeration types of C# more reliable than those of C++?
Write a program in C++ or C# that includes two different enumeration types and has a significant number of operations using the enumeration types. Also write the same program using only integer
Explain all of the differences between Ada’s subtypes and derived types.
What are the advantages of user-defined enumeration types?
Write a simple program in C++ to investigate the safety of its enumeration types. Include at least 10 different operations on enumeration types to determine what incorrect or just silly things are
What disadvantages are there in implicit dereferencing of pointers, but only in certain contexts?
Define ordinal, enumeration, and subrange types.
If you have access to a compiler in which the user can specify whether subscript range checking is desired, write a program that does a large number of matrix accesses and time their execution. Run
Compare the tombstone and lock-and-key methods of avoiding dangling pointers, from the points of view of safety and implementation cost.
Describe the three string length options.
Write a program that does matrix multiplication in some language that does subscript range checking and for which you can obtain an assembly language or machine language version from the compiler.
VAX minicomputers use a format for floating-point numbers that is not the same as the IEEE standard. What is this format, and why was it chosen by the designers of the VAX computers? A reference for
What are the design issues for character string types?
Determine whether some C compiler to which you have access implements the free function.
How does a decimal value waste memory space?
What are the advantages and disadvantages of decimal data types?
Design a set of simple test programs to determine the type compatibility rules of a C compiler to which you have access. Write a report of your findings.
What are the arguments for and against representing Boolean values as single bits in memory?
What is a descriptor?
What are the advantages of named constants?
What are the advantages and disadvantages of dynamic scoping?
Describe the encapsulation of an F# let inside a function and outside all functions.
What is the difference between the names defined in an ML let construct from the variables declared in a C block?
What is the purpose of the let constructs in functional languages?
What is a block?
What is a static ancestor of a subprogram? What is a dynamic ancestor of a subprogram?
What is the referencing environment of a statement?
Showing 600 - 700
of 965
1
2
3
4
5
6
7
8
9
10