Friday, October 19, 2018

Pseudocode GCE(O/L) Past Paper Questions and Answers

Question 1

A School has 1000 students. The following pseudocode segment prints the admission numbers of students who attended the school everyday (i.e 210 days) in a particular year.

N=0
While N <1000
         get AdmissionNumber
         get NumberOfDays
         if NumberOfDays=210 then
         	print AdmissionNumber
         end if
         N=N+1
End while

Draw a flowchart to represent the above pseudocode. (Use the same variable names as given in the pseudocode in your flowchart.)


Answer


GCE(O/L) Past Paper Pseudocode answer

Note for extra knowledge
Pseudocode and flowcharts are designing tool/technic for algorithm. Once we correctly did it, it would be very easy to write in any programming languages.
Pascal Program is given below.


progrma printadno;
var
  N:integer;
  AdmissionNumber:integer;
  NumberOfDays:integer;
begin
  N:=0;
  while N < 1000 do
  begin
    writeln('Enter Addmission Number ?');
    readln(AdmissionNumber);
    writeln('Enter Number of days?');
    readln(NumberOfDays);
    if NumberOfDays=210   then
       Writeln(AdmissionNumber);
   N:=N+1;
  end;
end.



1 comment:

  1. This is a great example of how pseudocode can be translated into a flowchart to visually represent logic! The use of loops and condition checks for identifying students attending all 210 days is clearly outlined. For those who want to create similar flowcharts or refine their pseudocode visually, Creately flowchart maker can simplify the process. It makes it easier to translate complex logic into clean, understandable diagrams!

    ReplyDelete