Skip to content

Write exercises

Submit APL code for the following exercises. Your submissions are graded using TMC.

Make sure to log in to be able to submit your work!

Remember, you can test out ideas and develop you solution at TryAPL before submitting it here.

You can submit as many solutions as you like. If you submit a correct solution at least once, you will receive points on the TMC server and be able to see the model solution.

If the write problem is red, it is unsolved. If it it green, you have solved it and received points for it on the server.


Write problem 1

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

⎕←


Write problem 2

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

⎕←


Write problem 3

If 3 liters of embalming fluid cost you 300.12€, what is the price per liter?

⎕←


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€?

⎕←


Write problem 5

Cause a SYNTAX ERROR using as few symbols as possible.

⎕←


Write problem 6

Cause a DOMAIN ERROR.

⎕←


Write problem 7

The following expression returns the number 13.

(((5*2)+(12*2))*.5)
Rewrite the expression with as few parentheses as possible to still return the number 13.
⎕←


Write problem 8

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

⎕←


Write problem 9

Suppose your tax rate is 7.5%. If you earned 25000€ this year, and your tax return (to be deducted from this year's taxes) is 175€, how much money will you owe the government this year?

⎕←


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 to use as few parentheses as possible

((((10+3.5)×(6+5.555))-(((2+7)ׯ11)×8.5))÷¯20)⍝((()())))()()((()()))()()()()))())))()(((
⎕←