Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee
Human-written only.
24/7 Support
Anytime, anywhere.
Plagiarism Free
100% Original.
Expert Tutors
Masters & PhDs.
100% Confidential
Your privacy matters.
On-Time Delivery
Never miss a deadline.
University of California, Irvine ICS 141 Chapter 6 - Check your understanding 1)Name eight major categories of control-flow mechanisms
University of California, Irvine
ICS 141
Chapter 6 - Check your understanding
1)Name eight major categories of control-flow mechanisms.
- What distinguishes operators from other sorts of functions?
- Explain the difference between prefix, infix, and postfix notation. What is Cambridge Polish notation? Name two programming languages that use post-fix notation.
- Why don’t issues of associativity and precedence arise in Postscript or Forth?
- What does it mean for an expression to be referentially transparent?
- What is the difference between a value model of variables and a reference model of variables? Why is the distinction important?
- What is an l-value? An r-value?
- Why is the distinction between mutable and immutable values important in the implementation of a language with a reference model of variables?
- Define orthogonality in the context of programming language design.
- What is the difference between a statement and an expression? What does it mean for a language to be expression-oriented?
- What are the advantages of updating a variable with an assignment operator, rather than with a regular assignment in which the variable appears on both the left- and right-hand sides?
Chapter 6.2
- Given the ability to assign a value into a variable, why is it useful to be able to specify an initial value?
- What are aggregates? Why are they useful?
- Explain the notion of definite assignment in Java and C#.
- Why is it generally expensive to catch all uses of uninitialized variables at run time?
- Why is it impossible to catch all uses of uninitialized variables at compile time?
- Why do most languages leave unspecified the order in which the arguments of an operator or function are evaluated?
- What is short-circuit Boolean evaluation? Why is it useful?
- List the principal uses of goto, and the structured alternatives to each.
- Explain the distinction between exceptions and multilevel returns.
- What are continuations? What other language features do they subsume?
- Why is sequencing a comparatively unimportant form of control flow in Lisp?
- Explain why it may sometimes be useful for a function to have side effects.
- Describe the jump code implementation of short-circuit Boolean evaluation.
- Why do imperative languages commonly provide a case or switch statement in addition to if... then ... else?
- Describe three different search strategies that might be employed in the implementation of a case statement, and the circumstances in which each would be desirable.
- Explain the use of break to terminate the arms of a C switch statement, and the behavior that arises if a break is accidentally omitted
- Describe three subtleties in the implementation of enumeration-controlled loops.
- Why do most languages not allow the bounds or increment of an enumeration controlled loop to be floating-point numbers?
- Why do many languages require the step size of an enumeration-controlled loop to be a compile-time constant?
- Describe the “iteration count” loop implementation. What problem(s) does it solve?
- What are the advantages of making an index variable local to the loop it controls?
- Does C have enumeration-controlled loops? Explain.
- What is a collection (a container instance)?
- Explain the difference between true iterators and iterator objects.
- Cite two advantages of iterator objects over the use of programming conventions in a language like C.
- Describe the approach to iteration typically employed in languages with first class functions.
- Give an example in which a mid-test loop results in more elegant code than does a pretest or post-test loop.
- What is a tail-recursive function? Why is tail recursion important?
- Explain the difference between applicative- and normal-order evaluation of expressions. Under what circumstances is each desirable?
- What is lazy evaluation? What are promises? What is memoization?
- Give two reasons why lazy evaluation may be desirable.
- Name a language in which parameters are always evaluated lazily.
- Give two reasons why a programmer might sometimes want control flow to be nondeterministic.
Expert Solution
PFA
Archived Solution
Unlocked Solution
You have full access to this solution. To save a copy with all formatting and attachments, use the button below.
Already a member? Sign In
Important Note:
This solution is from our archive and has been purchased by others. Submitting it as-is may trigger plagiarism detection. Use it for reference only.
For ready-to-submit work, please order a fresh solution below.
For ready-to-submit work, please order a fresh solution below.
Or get 100% fresh solution
Get Custom Quote





