I need to do this in the raptor program, but i don\'t understand pseudocode very
ID: 658655 • Letter: I
Question
I need to do this in the raptor program, but i don't understand pseudocode very well. can someone help me out?
Create an array with 5 numbers in it (8, 1, 12, 6 and 2)
find the lowest value in the array using a variable and a loop that compares the variable to each array element when the loop is done, display the lowest value of the array
Here is the rubric: An array of 5 elements is created and initialized to 0
The five elements of the array are initialized to 8, 1, 12, 6 and 2
A variable for the lowest value is set to numbers[1]
The loop condition is set to exit when the counter is no longer less than the size of the array
Inside the loop, lowest is compared to each array element
If the element is lower, then lowest is reset to that element value
The counter is incremented by 1
The lowest value is displayed after the loop exits
I don't need this is Java, C++, etc., I just want to know how to put this into Raptor.
Explanation / Answer
a[5]={8,1,12,6,2}
;
where in memory it will show s following figure :
a[0]=8;
a[1]=1;
a[2]=12;
a[3]=6;
a[4]=2;
whith a memory address.a[1]=1;
accourding to memory management ;
step 1: creat a temprary memory block ;
step 2: assign a value for the block bydefault=0;
step 3: shift the 1st value ;
and compare with second one ;
with register value allocation;
and it will on loop for the avove number or memory block ;
step 4: exit ;
the value for lowest in above array a
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.