Skip to content

Write exercises

Remember, you can test your code out on TryAPL before submitting it here! You can submit as many solutions as you like.

Since this course is still a work-in-progress, solving the write exercises will currently not lead to any credits.


Write problem 1

Calculate the area of a room which is 13.7 long and 206.55 wide.

⎕← 13.7 206.55


Write problem 2

A grandpa decreases in height by 2.5cm every year. If he is 150cm tall now, how tall will he be in 15 years?

⎕← 150 2.5 15


Write problem 3

If 12 chairs cost you 200000, what is the price per chair?

⎕← 200000 12


Write problem 4

Your current bank balance is ¯420€. You are in big trouble. What will be your balance if you take just another quick loan of 100€?

⎕← ¯420 100


Write problem 5

Cause a SYNTAX ERROR using as few symbols as possible.

⎕←


Write problem 6

Cause a DOMAIN ERROR.

⎕←


Write problem 7

Rewrite the following expression with as few parentheses as possible.

(((x*2)+(y*2))*.5)
⎕←


Write problem 8

Compute the mean of the numbers 1, 57, 237, ¯5, 42.

⎕← 1 57 237 ¯5 42


Write problem 9

You've got a 5 megawatt laser due in 15 days. If you've already got a 2.5 megawatt laser, how many megawatts a day do you have to add?

⎕← 5 15


Write problem 10

Subtract 7 from 16, divide the result by 3, add 8, multiply by 2.5, and square the result. Use as few parentheses as possible.

⎕←


Write problem 11

Write a nonempty line of code that does nothing (doesn't display anything on the screen).

⎕←


Write problem 12

Rewrite the following line of code using less than 7 parentheses, where x, y, and z are variables.

(((x+3.5)×(x+6))-((2+y)×(z×8.5))÷¯20)⍝((()())))()()((()()))()()()()))())))()(((
⎕←