RascalTutor
Synopsis

Test Case

Usage
rascal>NOW = $T20:11:01.463+00:00$;
datetime: $T20:11:01.463+00:00$
rascal>NOW.year = 2020;
Error: java.lang.UnsupportedOperationException: Cannot get year on a time value

1. Questions

Question 1

Replace the text box by the result of the intersection and make the test true:

module Question1

test bool setIntersection() =
     {-20,78,55,-37,94,-67,-9,-97,-79} & {-20,78,52,94,43,-97,69} == 
;
Question 2

Replace the text box by a function name and make the test true:

module Question2
import List;

test bool listFunction() =
 
([-40, -88, 35, 71, -21, -65, -61]) == ←40,[-88,35,71,-21,-65,-61]>;
Question 3

Which means of transportation is faster:

Apache Helicopter
High-speed train
Ferrari F430
Hovercraft
Question 4

Place all code fragments in the grey box in the right order with the right indentation

}
if(x > 0){
  x += 1;
y += 2;
println("hello");
Question 5

Click on all identifiers in this code fragment:

x = 1;
if(x){
   y = x + 2;
}
Question 6

Place all code fragments in the grey box in the right order with the right indentation (and avoid decoys):

}
y += 2;
println("hello");
if(x > 0){
  x += 1;
x #= 1;
Question 7

Reorder the following items and make all statements true:

  • "abc"
  • [1,2,3]
  • 123
  • {1,2,3}
  • is an int
  • is a list[int]
  • is a set[int]
  • is a str
Question 8

Reorder the following items and make all statements true:

  • 12
  • 5
  • "abcd"
  • 2
  • is less than 6
  • is equal to 10+2
  • is greater than 1
  • is equal to "ab" + "cd"