I'm new to programming language and I learning pseudocode.Firstly the question is like this:

11 7 12 36 15 -18 21 4 17 29
A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] A[9] A[10]

1)A[A[7]-A[3]]
2)A[3+2]


The second question is List and explain 3 type of iteration.

Recommended Answers

All 5 Replies

The first question: this isn't a question. Did you leave something out?

The second question: what do you think the answer is?

You give us your answers and we can confirm if you are correct, but we won't do your homework for you.

Just to give you idea, consider array as class room having 20 students sitting on chair where each chair is assigned a uniqe auto number, first chair has number 1, second has 2 and so on to number 20. Class room is the ARRAY and students are the ITEMS in array with each unique ID (number 1,2,3...)

In your case A is your class rooom and 11 7 12 36 15 -18 21 4 17 29 are students of class room A.

students are sit in order :A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] A[9] A[10]

Class room A and its chair number 1: 11 is sitting here
Class room A and its chair number 2: 7 is sitting here
........................................................
........................................................
........................................................
Class room A and its chair number 20: 29 is sitting here

Else your questions are simple, just understand the above example. And always think about any real time example before your start writing pseudocode.

The first question: this isn't a question. Did you leave something out?

The second question: what do you think the answer is?

You give us your answers and we can confirm if you are correct, but we won't do your homework for you.

WaltP : I'm new to programming , I was learning how to read array pseudo code . This is the question that I create myself. Anyway, thank your reply.

Just to give you idea, consider array as class room having 20 students sitting on chair where each chair is assigned a uniqe auto number, first chair has number 1, second has 2 and so on to number 20. Class room is the ARRAY and students are the ITEMS in array with each unique ID (number 1,2,3...)

In your case A is your class rooom and 11 7 12 36 15 -18 21 4 17 29 are students of class room A.

students are sit in order :A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] A[9] A[10]

Class room A and its chair number 1: 11 is sitting here
Class room A and its chair number 2: 7 is sitting here
........................................................
........................................................
........................................................
Class room A and its chair number 20: 29 is sitting here

Else your questions are simple, just understand the above example. And always think about any real time example before your start writing pseudocode.

Your senario is helpful. Between, can you create ascending and descending according the student ID in pseudo code??

I still learning how to read the pseudo code. And according to my 1st threat:
1)A[A[7]-A[3]] mean value of A[7] - value of A[3]
=21-12
=9

2)A[3+2]
=A[5]

A[5] value is 15

Am I correct?

Your senario is helpful. Between, can you create ascending and descending according the student ID in pseudo code??

I still learning how to read the pseudo code. And according to my 1st threat:
1)A[A[7]-A[3]] mean value of A[7] - value of A[3]
=21-12
=9

2)A[3+2]
=A[5]

A[5] value is 15

Am I correct?

1)A[A[7]-A[3]] means A[9] that is = 17 and second is correct.

If you want to sort the array you have to use the loop. I am not givinf you exact code but just an idea:

Run one loop to the length of array
Run inner loop to the length of array
Compare the items

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.