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() =
     {3,34} & {3,34,61} == 
;
Question 2

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

module Question2
import List;

test bool listFunction() =
 
([-36, 87, -77, 4, -3, 2, 15, -37, 42]) == ←36,[87,-77,4,-3,2,15,-37,42]>;
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):

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

Reorder the following items and make all statements true:

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

Reorder the following items and make all statements true:

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