Question

a. Design the logic for a program that allows a user to enter 12 numbers, then...

a. Design the logic for a program that allows a user to enter 12 numbers, then displays them in the reverse order of entry. b. Modify the reverse-display program so that the user can enter any amount of numbers up to 12 until a sentinel value is entered. ( I really could use more of a pseudocode rather than actual code. also an explanation of each step. The answer I got last time was just c++ code that including a few things we havent even covered in my class yet. )

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Below we will just look at the pseudo code to do it

a) We need 12 numbers and store them , then show them in reverse order.

1) int x[12] //declare an array to store 12 elements

2) int number // declare a integer to hold value entered by user

3) do for i =0 to 11 step 4 //we need a for loop to ask user to enter values and loop till 11 as we need 12 values

4) x[i] = number // here in our code we can use printf and scanf to ask user to enter number and scan that value in number and whats shown here is store that number in array.

5) end for //loop ends.

6) do for i = 11 to 0 step 7 // loop from last index to first as we need to show data in reverse order.

7) //here use printf to display x[i] value to console.

b) Could you explain more what is exactly required in b part.

Add a comment
Know the answer?
Add Answer to:
a. Design the logic for a program that allows a user to enter 12 numbers, then...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT