2. For each of the following loops, indicate what values will be printed when the loop...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. For each of the following loops, indicate what values will be printed when the loop is executed. If the loop is illegal or produces no output, provide that information as your answer. Assume that all variables have integer type and have already been declared where necessary. (a) Ada N = 10; for I in reverse 1..N loop Put (I); N = N 1; end loop; (b) Java for (int i = 0, j = 10; i < 2 * j; i++, j--) System.out.println(i); 2. For each of the following loops, indicate what values will be printed when the loop is executed. If the loop is illegal or produces no output, provide that information as your answer. Assume that all variables have integer type and have already been declared where necessary. (a) Ada N = 10; for I in reverse 1..N loop Put (I); N = N 1; end loop; (b) Java for (int i = 0, j = 10; i < 2 * j; i++, j--) System.out.println(i);
Expert Answer:
Related Book For
Principles of Auditing and Other Assurance Services
ISBN: 978-0078025617
19th edition
Authors: Ray Whittington, Kurt Pany
Posted Date:
Students also viewed these programming questions
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Besides warehouse layout decisions, what are some other applications where ranking items according to bang/buck might make sense?
-
Ditek Corp. provides a defined contribution pension plan for its employees. The plan requires Ditek to con- tribute 5% of employees' gross pay to a fund trustee each year. Ditek's total payroll for...
-
If you were hired to advise Michael Jeffries on A&F's current organizational design, what weaknesses and potential threats would you identify? What strengths and opportunities?
-
The work output of a \(50 \%\) efficient heat engine giving off \(60 \mathrm{~J}\) of energy as waste heat is (a) \(50 \mathrm{~J}\) (b) \(60 \mathrm{~J}\) (c) \(45 \mathrm{~J}\) (d) \(70...
-
1. What problems such as lawsuits, reputation, and public image would GarageTek face if they closed failing franchises? 2. Is shuttering the failed franchises the right move for Shuman? What are his...
-
7: A bouncy ball rolls off a 1 meter high desk with an initial horizontal velocity and executes projectile motion. With each bounce, it only gets to 80% of the maximum height of the previous bounce....
-
A population grows according to an exponential growth model, with Po= 80 and P = 152 Complete the recursive formula: P = || xP-1 Enter an integer or decimal number [more.. Write an explicit formula...
-
1. Write a function that deletes the second node from the linked list. The function should receive a pointer which points to the first node in the linked list. Each node is formed by the below...
-
Write a complete c++ program code which can solve at least three linear algebraic equation. You can use any method available to solve. one of the method is by using inverse of a matrix. C R your...
-
Let f(x)=2x+3, g(x) = x - 4, and h(x)=4x-1. Compute (ho go f)(3).
-
- Discuss the benefits implementation of the IDS/IPS, in terms of: I. To understand the IDS/IPS System for an organization and relate the Implementation with the Policy of the organization II....
-
Chris Smith - Owner and Senior Accountant B.Ec. (Accounting major), M.Tax (UNSW), FIPA Director Chris is a registered tax agent and an accountant who has been in public practice as an accountant...
-
Give the major product NH :? [H*] -H,0 Edit [H] -H20
-
What are conversion costs? What are prime costs?
-
The role of the auditor in the American economy has changed over the years in response to changes in our economic and political institutions. Consequently, the nature of an audit today is quite...
-
What is meant by the term ethical dilemma? Describe an ethical dilemma that you have faced. Discuss.
-
The auditors of Dunbar Electronics want to limit the risk of material misstatement in the valuation of inventories to 2 percent. They believe that there exists a 50 percent risk that a material...
-
The end gear connected to the shaft is subjected to the loading shown. If the bearings at \(A\) and \(B\) exert only \(y\) and \(z\) components of force on the shaft, determine the equilibrium torque...
-
The 50 -mm-diameter shaft is supported by journal bearings at \(A\) and \(B\). If the pulleys \(C\) and \(D\) are subjected to the loadings shown, determine the absolute maximum bending stress in the...
-
The pulleys fixed to the shaft are loaded as shown. If the journal bearings at \(A\) and \(B\) exert only horizontal and vertical forces on the shaft, determine the required diameter of the shaft to...
Study smarter with the SolutionInn App