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.5cm every year. If he is 150cm tall now, how tall will he be in 15 years?
Write problem 3
If 12 chairs cost you 200000, what is the price per chair?
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
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.
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?
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.
((((x+3.5)×(x+6))-(((2+y)×(z×8.5))÷¯20)⍝((()())))()()((()()))()()()()))())))()(((