Questionnaire Closed

Thank you for your interest in the questionnaire concerning the concept of roles of variables. The questionnaire has been closed and this page is now inactive. You can browse the questionnaire and get feedback in the second phase but you cannot submit your results anymore.


The original page starts here:


Phase 3: Classify Variables

There are 6 programs on this web page. The instructions are similar to those of the previous phase, except that you click on Submit when you have completed the selection of roles for all variables in all programs. Your selections will then be automatically included in the research data base.

In this phase you may select "some other role" if you think that the roles that have been presented do not adequately characterize a variable. If you choose "some other role" or if you were very unsure about your selection, please write a short explanation of what you think characterizes the role of these variables.

You must select a role for each variable; it is possible to select "I do not know", but we would prefer that you do not do so. If you really have to use it, please explain what problems you had with the variable.


1.

program histogram (input, output);

(* Draw a histogram *)

const longest = 40;                   (* Longest bar          *)
var   amount : array [1..12] of real; (* Data for drawing     *)
      max : real;                     (* Maximum data element *)
      month,                          (* Current month        *)
      i : integer;
begin
      for month := 1 to 12 do begin
          write('Enter amount for month ', month : 2, ': ');
          readln(amount[month]);
          if month = 1 then max := amount[1]
                   else if max < amount[month] then max := amount[month]
      end;
      writeln;
      for month := 1 to 12 do begin
          write(month : 2, ': ');
          for i := 1 to round(amount[month] / max * longest) do write('*');
          writeln
      end
end.

Determine appropriate role for each of the variables:
amount max month i  
fixed value
stepper
most-recent holder
most-wanted holder
gatherer
transformation
follower
some other role
I do not know

If you selected "some other role" or "I do not know" for any of the variables, or if you were very unsure about your selection, please explain what you think characterizes the role of these variables.


2.

program growth (input, output);

(* Growth of capital on a bank account *)

var capital,            (* Capital on the bank account *)
    percent,            (* Interest rate               *)
    factor,             (* Factor for yearly growth    *)
    interest: real;     (* Interest in current year    *)
    years,              (* Time to consider            *)
    i       : integer;  (* Year counter                *)
begin
    write('Enter capital (positive or negative): '); readln(capital);
    write('Enter interest rate (%): '); readln(percent);
    write('Enter time (years) : '); readln(years);
    writeln;
    factor := percent / 100;
    for i := 1 to years do begin
        interest := capital * factor;
        capital := capital + interest;
        writeln('After ', i : 2, 'years: interest is ', interest : 11 : 2,
                ' and total capital is ', capital : 12 : 2)
    end
end.

Determine appropriate role for each of the variables:
capital percent factor interest years i  
fixed value
stepper
most-recent holder
most-wanted holder
gatherer
transformation
follower
some other role
I do not know

If you selected "some other role" or "I do not know" for any of the variables, or if you were very unsure about your selection, please explain what you think characterizes the role of these variables.


3.

program lexical (input, output);

(* Lexical type recognition; spaces ignored *)

type Lex = (Digit, Letter, Op, Space, Period, Error);
var  c:  char;       (* Current character from input      *)
     lt: Lex;        (* Lexical type of current character *)
begin
     writeln('Enter expression, terminate with ''.'': ');
     repeat
         read(c);
         if c = ' ' then lt := Space
         else if c = '.' then lt := Period
         else if c in ['+', '-', '*', '/'] then lt := Op
         else if ('0' <= c) and (c <= '9') then lt := Digit
         else if ('a' <= c) and (c <= 'z') then lt := Letter
         else lt := Error;
         case lt of
             Digit:  write('Digit ');
             Letter: write('Letter ');
             Op:     write('Op ');
             Period: writeln;
             Error:  write('Error');
         end
     until (lt = Error) or (lt = Period)
end.

Determine appropriate role for each of the variables:
c lt  
fixed value
stepper
most-recent holder
most-wanted holder
gatherer
transformation
follower
some other role
I do not know

If you selected "some other role" or "I do not know" for any of the variables, or if you were very unsure about your selection, please explain what you think characterizes the role of these variables.


4.

program saw (input, output);

(*  Read a sequence of values and check if they form a 'saw':
    adjacent values go up and then down. *)

const last = 7;
type  ArrayType = array [1..last] of integer;
var   value: ArrayType;   (* Values to be checked           *)
      i:      integer;    (* Index of array                 *)
      up,                 (* Current direction is up ?      *)
      Ok: Boolean;        (* Does saw property still hold ? *)
begin
      writeln('Enter ', last, ' values:');
      for i:=1 to last do read(value[i]);
      up := value[1] < value[2];
      Ok := value[1] <> value[2];
      i := 2;
      while Ok and (i < last) do begin
          Ok := (up and (value[i] > value[i+1])) or
                (not up and (value[i] < value[i+1]));
          up := not up;
          i := i + 1
      end;
      write('Values ');
      if not Ok then write('do not ');
      writeln('form a saw.')
end.

Determine appropriate role for each of the variables:
value i up Ok  
fixed value
stepper
most-recent holder
most-wanted holder
gatherer
transformation
follower
some other role
I do not know

If you selected "some other role" or "I do not know" for any of the variables, or if you were very unsure about your selection, please explain what you think characterizes the role of these variables.


5.

program fibonacci (input, output);

(* Fibonacci series *)

var count,           (* Number of values to print *)
    i,               (* Number of current value   *)
    fibN,            (* N:th Fibonacci number     *)
    fibN_1,          (* N-1:th Fibonacci number   *)
    fibN_2: integer; (* N-2:th Fibonacci number   *)
begin
    write('How many Fibonacci numbers you want: '); readln(count);
    fibN_1 := 1; fibN_2 := 1;
    if count >= 1 then writeln('No. 1 in series is ', fibN_2);
    if count >= 2 then writeln('No. 2 in series is ', fibN_1);
    for i := 3 to count do begin
	fibN := fibN_1 + fibN_2;
	writeln('No. ', i, ' in series is ', fibN);
	fibN_2 := fibN_1;
	fibN_1 := fibN
    end
end.

Determine appropriate role for each of the variables:
count i fibN fibN_1 fibN_2  
fixed value
stepper
most-recent holder
most-wanted holder
gatherer
transformation
follower
some other role
I do not know

If you selected "some other role" or "I do not know" for any of the variables, or if you were very unsure about your selection, please explain what you think characterizes the role of these variables.


6.

program twoLargest (input, output);

(* Largest and second largest input value *)

var value,           (* Input value                *)
    largest,         (* Largest input value so far *)
    second: integer; (* Second largest so far      *)
begin
    largest := -1;
    second  := -1;
    write('Enter value (negative to end): '); readln(value);
    while value >= 0 do begin
        if value > largest then begin
	    second := largest;
	    largest := value
	end
	else if value > second then second := value;
	write('Enter value (negative to end): '); readln(value)
    end;
    if largest > 0 then writeln('Largest was ', largest);
    if second  > 0 then writeln('Second largest was ', second)
end.

Determine appropriate role for each of the variables:
value largest second  
fixed value
stepper
most-recent holder
most-wanted holder
gatherer
transformation
follower
some other role
I do not know

If you selected "some other role" or "I do not know" for any of the variables, or if you were very unsure about your selection, please explain what you think characterizes the role of these variables.


(A reminder: The questionnaire has been closed and this page is now inactive. The following fields cannot be used to submit information anymore.)


If you have any comments on the role concept or on specific roles, or if you had problems with classifying variables, please write your comments and ideas here:

Please enter your name and email address, which will be kept completely confidential. You are not required to enter your name and email address, but if you do we will be happy to send you any reports and articles based on this research.

Name:

E-mail:

Please check all the boxes below that apply:


(Submit button removed)


Last updated: October 23, 2002

Jorma.Sajaniemi@Joensuu.Fi