Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Management Expert

1. Design an algorithm for finding all the factors of a positive integer. For example, in the case of the integer 12, your algorithm should report the values 1, 2, 3, 4, 6, and 12.

2. Does the following program represent an algorithm in the strict sense? Why or why not?

Count = 0

while (Count != 5):

    Count = Count + 2

3. Rewrite the following program segment using a repeat structure rather than a while structure. Be sure the new version prints the same values as the original.

Count = 2

while (Count < 7):

  print(Count)

  Count = Count + 1

4. The following program segment is designed to compute the product of two nonnegative integers X and Y by accumulating the sum of X copies of Y; that is, 3 times 4 is computed by accumulating the sum of three 4s. Is the program segment correct? Explain your answer.

Product = 0

Count = 0

repeat:

   Product = Product + Y

   Count = Count + 1

until (Count == X)

5. Design an algorithm that, when given an arrangement of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, rearranges the digits so that the new arrangement represents the next larger value that can be represented by these digits (or reports that no such rearrangement exists if no rearrangement produces a larger value). Thus 5647382901 would produce 5647382910.

6. Four prospectors with only one lantern must walk through a mine shaft. At most, two prospectors can travel together and any prospector in the shaft must be with the lantern. The prospectors, named Andrews, Blake, Johnson, and Kelly, can walk through the shaft in one minute, two minutes, four minutes, and eight minutes, respectively. When two walk together they travel at the speed of the slower prospector. How can all four prospectors get through the mine shaft in only 15 minutes? After you have solved this problem, explain how you got your foot in the door.

7. Identify the body of the following loop struc- ture and count the number of times it will be executed. What happens if the test is changed to read "(Count != 6)"?

Count = 1

while (Count != 7):

  print(Count)

  Count = Count + 3

8. In what sense do the following three steps not constitute an algorithm?

Step 1: Draw a straight line segment between the points with rectangular coordinates (2,5) and (6,11).

Step 2: Draw a straight line segment between the points with rectangular coordinates (1,3) and (3,6).

Step 3: Draw a circle whose center is at the intersection of the previous line segments and whose radius is two

9. Rewrite the following program segment using a while structure rather than a repeat structure. Be sure the new version prints the same values as the original.

Count = 1

repeat:

print(Count)

Count = Count + 1

until (Count >= 7)

10. What is the difference between a formal programming language and a pseudocode?

11. What is the difference between syntax and semantics?

12. What letters are interrogated by the binary search (Figure 5.14) if it is applied to the list A, B, C, D, E, F, G, H, I, J, K, L, M, N, O when searching for the value J? What about search- ing for the value Z?

13. Write an algorithm to take a positive integer n as input and produce the sum of 1+2+..+n. Your algorithm must use while loop control

14. Writean algorithm to take a positive integer n as input and produce the sum of 1+2+..+n. Your algorithm must use recursive control

Business Management, Management Studies

  • Category:- Business Management
  • Reference No.:- M92496547
  • Price:- $15

Priced at Now at $15, Verified Solution

Have any Question?


Related Questions in Business Management

Define what a contingency plan is and provide at least one

Define what a contingency plan is and provide at least one reason for developing a contingency plan.

If health care employees are happy in their jobs do you all

If health care employees are happy in their jobs, do you all see incentives as a major issue in employees deciding to remain at a place of employment? Further, can incentives be in the form of monetary, or recognition of ...

During jimmy carters presidency increases in the consumer

During Jimmy Carter's presidency, increases in the Consumer Price Index (CPI) reached double digits. In order to combat this problem, the Carter administration launched a Wage-Price Guidelines program in which businesses ...

How much of the opposing side should you share in a

How much of the opposing side should you share in a presentation to a multiple-perspective audience, and what techniques would you use?

Discuss the question of a common mortality that people of

Discuss the question of a common mortality that people of all nations could share. Is there one moral philosophy that seems to be applied across nations? If so which one and why? Not so, why? Share the individual standar ...

How would i concatenate an address in multiple rows using

How would I concatenate an address in multiple rows using Oracle SQL? The address should be in one row using the following format ("address, city, state. zipcode"). The table name is vendors and the rows are vendor_addre ...

Use at least 3-5 citations to provide information about

Use at least 3-5 citations to provide information about Americans doing business in India

How do you evaluate the implementation of the strategic

How do you evaluate the implementation of the strategic plan? Please, explain.

Do you agree or disagree with your classmates postsminimum

Do you agree or disagree with your classmates' posts? Minimum 100 words reply for: We should care about the "hidden cities", I think its "hidden cities" plays as a role to help the development of the international busine ...

Imagine your workplace is experiencing low productivity and

Imagine your workplace is experiencing low productivity and staff are experiencing poor morale due to customer service difficulties. Access and read your organisational customer service policy. Based on this document, ev ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As