Sales Commission
November 17, 2020
Today’s exercise is simple drill for beginning programmers; it was inspired by a student asking on a beginning programmer’s platform for someone to do his homework for him. The requested answer was in C++, and it was a few weeks ago, so I don’t feel too bad posting a Scheme solution:
Write a program that inputs each employee’s sales, then computes and prints the employee’s commission according to the formula $200 plus 10% of sales. Stop the input using a sentinel value. At the end of the input, display a one-dimensional array containing all the commission amounts, and the total amount of commission paid. You may not use a switch statement or multiple if statements.
Your task is to write a solution to the student’s homework; don’t use C++. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.
Memfrob
November 10, 2020
Memfrob is a light encryption algorithm that works by xor
-ing 4210 = 001010102 with each input byte to create encrypted output; decryption is symmetric with encryption. Memfrob is roughly equivalent to ROT13 in cryptographic security.
Your task is to implement memfrob. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.
Surfraw
November 6, 2020
For the last few days I’ve been playing with surfraw
, a command-line program that allows easy access to a variety of search engines. About a hundred elvi
(search agents) are provided, and it is easy to add your own. You can get surfraw
from your favorite code repository (for me, it was sudo apt install surfraw
). I use lynx for the browser, so everything works on the command line.
Your task is to install surfraw
on your machine, write a custom elvi
, and share it with the rest of us. When you are finished, you are welcome to read a suggested solution, or to post your own solution or discuss the exercise in the comments below.