Answer to Question #36479 in C++ for Evan Jamal

Question #36479
Translate this pseudo code to C++ program. In the C++ program write down the line numbers from the pseudo code against the corresponding implementation. HINT: you need an elementary knowledge of arrays. You only need to know how to declare an integer array and how to put initial values in the array. I know this was never covered in class, but it is easy and will give you the sense of achievement if you learn it by yourself. Use your book or any online resource. 1 A() = {12, 11, 3, 90, 15}; 2 For K = 0 to N - 1 // Initialize integer N to be equal to 5 3 For J =0 to N - 1 4 If (A(J) > A(J + 1) 5 Temp = A(J) 6 A(J) = A(J + 1) 7 A(J + 1) = Temp 9 End-If 10 End-For 11 End-For 12 Display the content of A. HINT: A subtle difference: The pseudo code uses parenthesis in arrays but C++ code will use brackets.
Expert's answer

Not answered

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

New on Blog