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
Ask a Question
Search
Search
Sign In
Register
study help
computer science
concepts of programming languages
Questions and Answers of
Concepts of Programming Languages
Argue in support of the Ada 83 designers’ decision to allow the implementer to choose between implementing in out- m ode parameters by copy or by reference.
What is given in the header of a subprogram?
Write a C# or Ada program that determines when the address of an out-mode parameter is computed (at the time of the call or at the time the execution of the subprogram finishes).
In most Fortran IV implementations, all parameters were passed by reference, using access path transmission only. State both the advantages and disadvantages of this design choice.
What does it mean for a subprogram to be active?
Write a program in a language that you know to determine the ratio of the time required to pass a large array by reference and the time required to pass the same array by value. Make the array as
What are arguments for and against a user program building additional definitions for existing operators, as can be done in Python and C++? Do you think such user-defined operator overloading is good
What are the three general characteristics of subprograms?
What common programming language borrows part of its design from Dijkstra’s guarded commands?
What language predefines iterators that can be explicitly called to iterate over its predefined data structures?
How are iterators implemented in Ruby?
How does a functional language implement repetition?
What Scheme function implements a multiple selection statement?
What is a user-defined iteration control?
What are the differences between the break statement of C++ and that of Java?
What advantage does Java’s break statement have over C’s break statement?
What are the design issues for user-located loop control mechanisms?
What are the design issues for logically controlled loop statements?
What contemporary languages do not include a goto?
What does the range function in Python do?
In what way is C’s for statement more flexible than that of many other languages?
What is the difference between the for statement of C++ and that of Java?
What is a pretest loop statement? What is a posttest loop statement?
What are the design issues for counter-controlled loop statements?
What are the design issues for all iterative control statements?
Explain how C#’s switch statement is safer than that of C.
Speculate as to the reason control can be transferred into a C loop statement.
On what previous language was C’s switch statement based?
Describe three specific programming situations that require a posttest loop.
What is unusual about C’s multiple-selection statement?
Describe a programming situation in which the else clause in Python’s for statement would be convenient.
Between what two language characteristics is a trade-off made when deciding whether more than one selectable segment is executed in one execution of a multiple selection statement?
What are the arguments both for and against the exclusive use of Boolean expressions in the control statements in Java (as opposed to also allowing arithmetic expressions, as in C++)?
What are the design issues for multiple-selection statements?
Translate the following call to Scheme’s COND to C and set the resulting value to y. (COND ( (> x 10) x) ((< x 5) (* 2 x)) ( (= x 7) (+ x 10))
Rewrite the C program segment of Programming Exercise 4 in Java without using a switch statement.Data From Exercise 4:Consider the following C program segment. Rewrite it using no gotos or breaks. j
In his paper on the goto issue, Knuth (1974) suggests a loop control statement that allows multiple exits. Read the paper and write an operational semantics description of the statement.
What are the common solutions to the nesting problem for two-way selectors?
Rewrite the C program segment of Programming Exercise 4 using if and goto statements in C.Data From Exercise 4:Consider the following C program segment. Rewrite it using no gotos or breaks. j = -3;
Use the Science Citation Index to find an article that refers to Knuth (1974). Read the article and Knuth’s paper and write a paper that summarizes both sides of the goto issue.
Under what circumstances must an F# selector have an else clause?
Consider the following programming problem: The values of three integer variables—first, second, and third—must be placed in the three variables max, mid, and min, with the obvious meanings,
Analyze the potential readability problems with using closure reserved words for control statements that are the reverse of the corresponding initial reserved words, such as the case-e sac reserved
What is unusual about Python’s design of compound statements?
What are the arguments, pros and cons, for Python’s use of indentation to specify compound statements in control statements?
What are the design issues for selection structures?
Consider the following C program segment. Rewrite it using no gotos or breaks. j = -3; for (i = 0; i < 3; i++) { switch (j + 2) { case 3: 2: j--; break; 0: j += 2; break; case case default: j = 0; }
What are the pros and cons of using unique closing reserved words on compound statements?
What is/are the design issue(s) for all selection and iteration control statements?
Rewrite the following code segment using a multiple- selection statement in the following languages:a. C, C++, Java, or C#b. Pythonc. RubyAssume all variables are integer type. Discuss the relative
Compare the set of Ada control statements with those of C# and decide which are better and why.
What is the definition of block?
Redo Programming Exercise 1, except this time make all the variables and constants floating- point type, and change the statementk = k + 1tok = k + 1.2Data From Exercise 1:Rewrite the following
Study the iterator feature of CLU in Liskov et al. (1981) and determine its advantages and disadvantages.
What did Böhm and Jocopini prove about flowcharts?
Rewrite the following pseudocode segment using a loop structure in the specified languages:a. C, C++, Java, or C#b. Pythonc. RubyAssume all variables are integer type. Discuss which language, for
Describe three situations where a combined counting and logical looping statement is needed.
What is the definition of control structure?
What is a cast?
What mixed-mode assignments are allowed in ML?
What mixed-mode assignments are allowed in Java?
What is one possible disadvantage of treating the assignment operator as if it were an arithmetic operator?
What is the associativity of C’s unary arithmetic operators?
What is the purpose of a compound assignment operator?
How does C support relational and Boolean expressions?
Why does Java specify that operands in expressions are all evaluated in left-to-right order?
Name a language that always does short-circuit evaluation of Boolean expressions. Name one that never does it.
Consider the following C program:What is the value of x after the assignment statement in main, assuminga. Operands are evaluated left to right.b. Operands are evaluated right to left. int fun (int
What is short-circuit evaluation?
Should an optimizing compiler for C or C++ be allowed to change the order of subexpressions in a Boolean expression? Why or why not?
How does operand evaluation order interact with functional side effects?
Determine whether the narrowing explicit type conversions in two languages you know provide error messages when a converted value loses its usefulness.
What are the advantages of referential transparency?
For some language of your choice, make up a list of operator symbols that could be used to eliminate all operator overloading.
What is referential transparency?
Explain why it is difficult to eliminate functional side effects in C.
What is a mixed-mode expression?
What is your primary argument against (or for) the operator precedence rules of APL?
In JavaScript, what is the difference between == and ===?
Let the function fun be defined asSuppose fun is used in a program as follows:What are the values of sum1 and sum2a. Operands in the expressions are evaluated left to right?b. Operands in the
Define narrowing and widening conversions.
Using the grammar of Problem 11, draw parse trees for the expressions of Problem 9.Data From Problem 11:Write a BNF description of the precedence and associativity rules defined for the expressions
What is an overloaded operator?
Write a BNF description of the precedence and associativity rules defined for the expressions in Problem 9. Assume the only operands are the names a, b, c, d, and e.Data From Problem 9:Assume the
What is a conditional expression?
Show the order of evaluation of the expressions of Problem 9, assuming that there are no precedence rules and all operators associate right to left.Data From Problem 9:Assume the following rules of
What is a coercion?
Assume the following rules of associativity and precedence for expressions:Show the order of evaluation of the following expressions by parenthesizing all subexpressions and placing a superscript on
Write a program in either Java, C++, or C# that performs a large number of floating-point operations and an equal number of integer operations and compare the time required.
Define functional side effect.
Describe a situation in which the add operator in a programming language would not be associative.
Write a C program that has the following statements:and define fun to add 10 to a. Explain the results. int а, b; a = 10; b = a + fun (); printf("With the function call on the right, ") printf (" b
Describe a situation in which the add operator in a programming language would not be commutative.
Write a program in either C++, Java, or C# that illustrates the order of evaluation of expressions used as actual parameters to a method.
What associativity rules are used by APL?
Should C’s single-operand assignment forms (for example, ++count) be included in other languages (that do not already have them)? Why or why not?
Repeat Programming Exercise 4 with C#.Data from Exercise 4: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 nonassociative operator?
Should C’s assigning operations (for example, +=) be included in other languages (that do not already have them)? Why or why not?
Repeat Programming Exercise 4 with C++.Data from Exercise 4:Write a Java program that exposes Java’s rule for operand evaluation order when one of the operands is a method call.
Showing 500 - 600
of 965
1
2
3
4
5
6
7
8
9
10