0

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.

3
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by sufyan2011
0

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.

0

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.

0

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.

0

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?

Edited by devianleong: n/a

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.