convert pseudocode langauge to c++ language

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WHG1962
    New Member
    • Oct 2015
    • 1

    convert pseudocode langauge to c++ language

    // Start
    // Declarations
    // num SIZE = 10
    // num NUMBERS[SIZE]
    // num i
    // num j
    // num temp
    // for i = 0 to SIZE - 1
    // output "Please enter a number: "
    // input NUMBERS[i]
    // endfor
    // for i = 0 to SIZE - 2
    // for j = 0 to SIZE - 2
    // if (NUMBERS[j] < NUMBERS[j+1])
    // temp = NUMBERS[j]
    // NUMBERS[j] = NUMBERS[j+1]
    // NUMBERS[j+1] = temp
    // endif
    // endfor
    // endfor
    // output "Sorted List"
    // output "========== ="
    // for i = 0 to SIZE - 1
    // output "Number ", i + 1, ": ", NUMBERS[i]
    // endfor
    // Stop
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    This code already compiles in C++. It's nothing but comments.

    I suggest you write an empty main() and insert this code inside it. Then remove one //, compile and fix the error. Then remove the next //, compile and fix the error.

    When the // are gone and it compiles, you are done.

    Comment

    Working...