Consider the following algorithm. Input: a, b, c (integers) Output: (integer) Alice(a, b, c){ k =...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the following algorithm. Input: a, b, c (integers) Output: (integer) Alice(a, b, c){ k = a if (b> k) k = k + 3 if (c > k) k = k + 5 return k } Write the answer for each question. 1. What is the output of the algorithm Alice for the input a = = 5, b = 4, c = 6? 2. What is the output of the algorithm Alice for the input a = 5, b = 7, c = 6? 3. What is the output of the algorithm Alice for the input a = 3, b = 6, c = 9? 4. What is the output of the algorithm Alice for the input a = 3, b = 2, c = 1? Consider the following algorithm. Input: a, b, c (integers) Output: (integer) Alice(a, b, c){ k = a if (b> k) k = k + 3 if (c > k) k = k + 5 return k } Write the answer for each question. 1. What is the output of the algorithm Alice for the input a = = 5, b = 4, c = 6? 2. What is the output of the algorithm Alice for the input a = 5, b = 7, c = 6? 3. What is the output of the algorithm Alice for the input a = 3, b = 6, c = 9? 4. What is the output of the algorithm Alice for the input a = 3, b = 2, c = 1?
Expert Answer:
Answer rating: 100% (QA)
Lets go through each question step by step For the input a 5 b 4 c 6 Initially ... View the full answer
Related Book For
Discrete and Combinatorial Mathematics An Applied Introduction
ISBN: 978-0201726343
5th edition
Authors: Ralph P. Grimaldi
Posted Date:
Students also viewed these programming questions
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
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...
-
PLEASE GIVE CORRECT ANSWERS Prove that the number of comparators in any sorting network is (n log n). [4 marks] (ii) What does Part (d)(i) imply in terms of the depth of any sorting network? [1 mark]...
-
The data in the chart below is for the distance (in cm) to the near point, the point nearest the eye at which the eye can accurately focus, at a persons age. Age (years) Near Point (cm) 10 7.5 20 9...
-
Pugliese Whole Foods, Inc., has the following information for the years ending December 31, 2016 and 2015: Requirements 1. Compute the rate of inventory turnover for Pugliese Whole Foods, Inc., for...
-
In a discussion between Peters and Ferrel, two auditing students, Peters made the following statement: A CPA is a professional person who is licensed by the state for the purpose of providing an...
-
Acetone is evaporating in a mixture of nitrogen and helium. Find the rate of evaporation and compare it with the rates in pure nitrogen and pure helium. Also compare it with the model using a...
-
Select an AIS system segment (such as purchasing, sales, or payroll), investigate, and write a report on the tangible and intangible costs and benefits associated with your selection.
-
Solve the Linear Systems by the method of elimination using Gaussian elimination for matrix linear algebra. linear equation 1 ( 2 x + 4 y + 6 z = - 1 2 ) Linear equation 2 ( 2 x - 3 y - 4 z = 1 5 )...
-
After finishing your Master of Professional Accounting, you started your accounting consultancy in Gold Coast, Queensland, Australia. You got a high distinction in HI5019 Strategic Information System...
-
This is an semiannually bond which is mean one half the yield and pmt, also double the period Bond B Bond A Coupon 8% 9% Yield to maturity 8% 8% Maturity (years) 2 5 Par $100.00 $100.00 Price $100.00...
-
If an investor gives $100,000 cash to purchase ownership interest to a company, gives a $50,000 cash loan to the same company at 8%, due in 10 years, and the company then purchases $20,000 in...
-
A business paid $ 8 0 , 0 0 0 for an exclusive franchise. What type of asset would this be for income tax purposes?
-
Joe Smith, who owns 100% of Corporation X (a C corporation), has decided to Corporation X acquire all the stock of Corporation Y (a C Corporation). The selling parent of Y is amenable to characterize...
-
To raise funds for Gravina Island Bridge, the Government of Alaska issued bonds. The bonds, called "Nowhere Bonds" have a face value of $1,000, 15 years to maturity, and a 7% coupon rate (annual...
-
Aulia, Arissa and Aydeen are in joint venture of interior design and house decoration. Below are the transactions that occurred in the last months : March 1 Aulia paid for design cost and printing...
-
Don Griffin worked as an accountant at a local accounting firm for five years after graduating from university. Recently, he opened his own accounting practice, which he operates as a corporation....
-
The ciphertext FTQIMKIQIQDQ was encrypted using the encryption function E: Z26 Z26 where E() = ( + k) mod 26. Considering the frequencies of occurrence for the letters in the ciphertext, determine...
-
(a) If the edges of K6 are painted either red or blue, prove that there is a red triangle or a blue triangle that is a subgraph. (b) Prove that in any group of six people there must be three who are...
-
Let T = (V, E) be a complete m-ary tree of height h. This tree is called a full m-ary tree if all of its leaves are at level h. If T is a full m-ary tree with height 7 and 279,936 leaves, how many...
-
What is the relation between degrees Fahrenheit and degrees Rankine? And the relation between degrees Celsius and Kelvin?
-
State Newton's second law as you would apply it to a control mass.
-
Define a 1-pound force in terms of the acceleration it will give to a 1-pound mass. Give a similar definition for a newton in the SI system.
Study smarter with the SolutionInn App