Monday, March 30, 2015

SBA NOTICE - FINAL

NOTICE
This is your LAST opportunity to submit your IT SBA final draft (printed and bound).  I will be at the lab this morning from 9am - 12 noon TODAY, Monday, March 30, 2015 collecting printed SBA.

For those students whose SBAs are with the Vice Principal to be bound, I have been given a list indicating the students who submitted at the office; you do not need to come.

For those students who submitted by flash drive on last Friday (to me directly) and has paid (or made arrangements) with Mrs. Tillett to pay for the printing, you also do not need to come, as your SBA is considered submitted.

NO OTHER OPPORTUNITY WILL BE OFFERED TO SUBMIT YOUR IT SBA 

Saturday, March 14, 2015

Coding Array of For Loop in Pascal

As you know, arrays are simple indexed elements, with the elements being the variable values.

Reminder:  To code the For loop in Pascal, we note:

For x = 1 to 10 do

is replaced with

For i := 1 to 10 do
begin

next

is replaced with

end;

Now we code the array.  As you may recall, the array in an algorithm is declared on the first line of the algorithm.  In Pascal, however, that is not the case.  The array(s) is declared under the variable declaration section.  Example below:

Algorithm - output the 3rd and 5th names entered of 10 names.

dim nam (1 to 10) as string
for x = 1 to 10 do
print "enter your name"
input nam$(x)
next
print "the 3rd and 5th names entered are:", nam$(3), nam$(5)
input key


Pascal -output the 3rd and 5th names entered of 10 names.

Program Names (input,output);
Var
nam : array [1..10] of string;
i : integer;
Begin
for i := 1 to 10 do
begin
writeln ('enter your name');
readln (nam[i]);
end;
writeln ('the 3rd and 5th names entered are:', nam[3], name[5]);
readln;
end.

You try one:  
Determine and output the largest of 5 numbers entered, and output the 3rd and 4th numbers entered.  Code in Pascal.