Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

1. For the algorithm presented below, what will be displayed in Line 9 given the following input in Line 2?

num1 = 4
num2 = 21
num3 = 14
num4 = 20

1 Prompt for num1, num2, num3, num4 
2 Get num1, num2, num3, num4 
3 Set index to 1 
4 DOWHILE index < 4 
5 IF num1 > num2 THEN 
Order_two_numbers (num1, num2) 
ENDIF 
6 IF num2 > num3 THEN 
Order_two_numbers (num2, num3) 
ENDIF 
7 IF num3 > num4 THEN 
Order_two_numbers (num3, num4) 
ENDIF 
8 add 1 to index
ENDDO 
9 Display num1, num2, num3, num4
END

Order_two_numbers (number1, number2) 
10 temp = number1 
11 number1 = number2 
12 number2 = temp
END

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9647247

Have any Question?


Related Questions in Computer Engineering

Subject computer algorithmsbook introduction to algorithms

Subject : Computer Algorithms Book: Introduction to Algorithms 3rd edition 1) a) Using Figure 10.1 as a model, illustrate the result of each operation in the sequence PUSH(S,6), PUSH(S,2), PUSH(S,8), POP(S), PUSH(S,5), P ...

Select one of the discussion topics and respond begin your

Select one of the discussion topics and respond. Begin your response by indicating which question you chose. Discussion topics: Section 1 Should the government set a maximum wage? Why or why not? Section 2 Most people be ...

Think about a good or service for which you believe there

Think about a good or service for which you believe there has been a shift in demand or supply. Explain the reasons behind the shift and how that has influenced the equilibrium price.

Can someone help me identify how intrustion detection

Can someone help me identify how Intrustion detection system and intrusion prevent system can help protect confidentiality, integrity and availability

Research the history of specification languages and write a

Research the history of specification languages, and write a report on the successes or failures of some of these languages. Include 5 languages which are successful and 5 which have failed. All work should be typed writ ...

Section 26 in the smith textbook elementary information

Section 2.6 in the Smith textbook ( elementary information security 2nd edition) offers a list of 6 high-level security controls. Pick two of them and describe how you personally experience those controls in use on perso ...

Suppose our task is to distinguish between humans and

Suppose our task is to distinguish between humans and non-human objects in an image, which classifier would you choose and why? Decision trees, perceptrons or neural nets.

Using c language how to write a function name bsqrt that

Using C++ language, how to write a function name bsqrt that will compute the square root of a number using the Babylonian method. This function will take the number x to compute the square root for and the number of iter ...

Search treestry to adopt all four traversal algorithm

Search trees. Try to adopt all four traversal algorithm procedures for any binary tree. Write methods to count the number of nodes in a binary tree to count the number of leaves to count the number of right children to f ...

Imagine an election with just two candidates candidate a

Imagine an election with just two candidates. Candidate A asks her consultant to conduct a poll to see if she (Candidate A) is leading. What is the "null hypothesis" value that is being "tested" in this example?  Your an ...

  • 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