1: Consider the following pseudocode fragment and answer corresponding questions. (For each question, you should clearly...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1: Consider the following pseudocode fragment and answer corresponding questions. (For each question, you should clearly show steps about how you get the answer.) count := 0 For i = 1 to 6 For j =i+2 to 9 count: i j + count b) c) d) End-for End-for a) For the iteration of the outer loop where i = 4, how many times does the inner loop iterate? (5 Points) How many times has the variable "count" increased? (5 Points) Suppose i = 5, what is the value of "count" after the execution of inner loop? (5 Points) What is the final value of "count" after the execution of this nested loop? (5 Points) Question 2: (20 Points) Compute the value of the following questions. (For each question, you should clearly show steps about how you get the answer.) a) (-99) div 10 (5 Points) b) (-328) mod 9 (5 Points) c) Suppose n mod 5 = 3, find all possible values of n. (5 Points) d) [(45 mod 7) + (62 mod 7)] mod 7 (5 Points) Question 3: (20 Points) Question 4: Give the prime factorization for each number in non-decreasing order and find the greatest common divisor (gcd) and least common multiple (lcm). (For each question, you should clearly show steps about how you get the answer.) a) 56 (4 Points) b) 90 (4 Points) c) 470 (4 Points) d) ged(48, 84) (4 Points) e) lcm(132, 176) (4 Points) Question 4: (20 Points) Convert a text message to a number or a number to a text message using a specific scheme. The scheme associates each lowercase letter to a 2-digit number in the range 01 through 26 ("a"=01, "b"=02,..., "z"=26) and the blank character to 27. (For each question, you should clearly show steps about how you get the answer.) a) 19200118 (4 Points) b) 1618091305 (4 Points) c) 80116160914051919 (4 Points) d) real madrid (4 Points) e) never give up (4 Points) 1: Consider the following pseudocode fragment and answer corresponding questions. (For each question, you should clearly show steps about how you get the answer.) count := 0 For i = 1 to 6 For j =i+2 to 9 count: i j + count b) c) d) End-for End-for a) For the iteration of the outer loop where i = 4, how many times does the inner loop iterate? (5 Points) How many times has the variable "count" increased? (5 Points) Suppose i = 5, what is the value of "count" after the execution of inner loop? (5 Points) What is the final value of "count" after the execution of this nested loop? (5 Points) Question 2: (20 Points) Compute the value of the following questions. (For each question, you should clearly show steps about how you get the answer.) a) (-99) div 10 (5 Points) b) (-328) mod 9 (5 Points) c) Suppose n mod 5 = 3, find all possible values of n. (5 Points) d) [(45 mod 7) + (62 mod 7)] mod 7 (5 Points) Question 3: (20 Points) Question 4: Give the prime factorization for each number in non-decreasing order and find the greatest common divisor (gcd) and least common multiple (lcm). (For each question, you should clearly show steps about how you get the answer.) a) 56 (4 Points) b) 90 (4 Points) c) 470 (4 Points) d) ged(48, 84) (4 Points) e) lcm(132, 176) (4 Points) Question 4: (20 Points) Convert a text message to a number or a number to a text message using a specific scheme. The scheme associates each lowercase letter to a 2-digit number in the range 01 through 26 ("a"=01, "b"=02,..., "z"=26) and the blank character to 27. (For each question, you should clearly show steps about how you get the answer.) a) 19200118 (4 Points) b) 1618091305 (4 Points) c) 80116160914051919 (4 Points) d) real madrid (4 Points) e) never give up (4 Points)
Expert Answer:
Answer rating: 100% (QA)
Steps Step 1 of 2 a When the outer loop is executed with i 3 the inner loop iterates 6 times Explana... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Casrnir proposes a model of third-culture building to account for the evolutionary nature of intercultural dialogue. What role do you think the many studies on cultural dimensions can play in the...
-
Indicate in which part of the statement of cash flows each item would appear: operating activities (O), investing activities (I), or financing activities (F). (a) _____ Cash received from customers....
-
Shown is the power consumption in the province of Ontario, Canada, for December 9, 2004 (P is measured in megawatts; t is measured in hours starting at midnight). Using the fact that power is the...
-
Dots Delicious Donuts has the following accounts on its balance sheet: (1) Current assets. (2) Property, plant, and equipment. (3) Intangible assets. (4) Other assets. (5) Current liabilities. (6)...
-
Per Corporation paid $900,000 cash for 90 percent of Sim Corporation's common stock on January 1, 2011, when Sim had $600,000 capital stock and $200,000 retained earnings. The book values of Sim's...
-
(5 points) Prove that {x")} EN does not converge uniformly in [0, 1]. (5 points) Let g be continuous on [0, 1] with g(1) = 0. Show that {x" g(x)} converges uniformly in [0, 1].
-
A bank categorizes its customers into one of three groups based on their banking habits. A random sample of 30 customers from each group was selected, and the number of times each customer visited...
-
An insurer issued a large number of policies to women aged 60, where sum insured S = 100,000, level premium P = 5,200, 5V = 29,068 and 6V = 35, 324. Five yeaers after they were issued, a total of 450...
-
Amitabh Bachan (AB), the Managing Director (MD) of Clothes Indonesia, was on a flight from Bangalore to Singapore on his way to Jakarta after a vacation. As he settled into the flight, his thoughts...
-
Need an Ethics in Action Recent / Current Events Case Study you will be reviewing current ethics, democracy, and leadership headlines, both domestic and international. Can be domestic or inter...
-
Pharoah Company's income statement for the year ended December 31, 2017, contained the following condensed information. Service revenue $842,000 Operating expenses(excluding depreciation $626,000...
-
Identify all of the facilities, organization ill have to access/interact with to achieve his treatment goal.
-
The direct materials cost, direct labor cost, and machine-hours used for Jobs P and Q are as follows: Direct materials Direct labor cost Actual machine-hours used: Fabrication Molding Total Job P $...
-
A machine with a cost of $190,000 and accumulated depreciation of $95,000 was sold for $50,000 cash. The amount that should be reported as a source of cash under cash flows from investing activities...
-
A circular concrete shaft liner with Youngs modulus of 3.4 million psi, Poissons ratio of 0.25, unconfined compressive strength 3,500 psi and tensile strength 350 psi is loaded to the verge of...
-
Linda and Richard are married and file a joint return for 2012. During the year, Linda, who works as an accountant for a national airline, used $2,100 worth of free passes for travel on the airline;...
-
In 2012, Lou has a salary of $54,000 from her job. She also has interest income of $1,700. Lou is single and has no dependents. During the year, Lou sold silver coins held as an investment for a...
-
Quince Interests is a partnership with a tax year that ends September 30, 2012. During that year, Potter, a partner, received $3,000 per month as a guaranteed payment, and his share of partnership...
-
An economist believes that the median income of lawyers who recently graduated from law school is more than \(\$ 64,000\). He queries a random sample of 12 lawyers and obtains the accompanying data....
-
One important variable to consider in trading stock is the daily volume. Volume is measured in number of shares traded in the stock. Stocks with lower volume tend to have more variability in the...
-
The median is less than 8 . An analysis of the data reveals that there are 10 minus signs and 8 plus signs. Use the sign test to test the given alternative hypothesis at the \(\alpha=0.05\) level of...
Study smarter with the SolutionInn App