Question

Step 3: Complete the following chart by writing what the counter and the totalNumbers value stores...

Step 3: Complete the following chart by writing what the counter and the totalNumbers value stores on each iteration of the loop.

Counter

totalNumbers

0

34

1

73

2

98

3

116

4

159

5

190

6

202

Lab 2 – Pseudocode and Arrays

This lab requires you to think about the steps that take place in a program by writing pseudocode. Read the following program prior to completing the lab.

Design the logic for a program that allows a user to enter 20 numbers, and then display them in the reverse order of entry.

For the programming problem, create the pseudocode and enter it below.

Enter pseudocode here

Homework Answers

Answer #1

//Pseudocode for Lab 2

Function Main
    Declare Integer Array arr[20]
    Declare Integer i
  
    Output "Enter 20 numbers: "
    For i = 0 to 19
        Input arr[i]
    End
    Output "Number in reverse order are: "
    For i = 19 to 0 decreasing
        Output arr[i]
    End
End

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions