I believe batch scripting is what you are looking for. You can check out:
Batch file - Wikipedia, the free encyclopedia
for the basics of creating a .bat file, you can also type commands directly into the command prompt, but it is likely that your cousin is using a bash script or a C program to accomplish arithmetic on the command line.