1: C++ on the cluster
Completion requirements
Opened: Thursday, 15 January 2026, 12:00 AM
Due: Thursday, 22 January 2026, 11:59 PM
Our first assignment is aimed at getting used to the Teach cluster. If you have any issues logging in, please ask a question by email, in the forum, or during the Wednesday office hours.
Your task for this assignment is:
- To log into the teach cluster;
- Open an editor (e.g. nano), and type in the following C++ code:

- Save the code in a file with the name "getsecretword.cpp".
- Load the gcc/14.3 module.
- Compile "getsecretword.cpp".
- Run the code.
- The code will display some output, including a 'secret word'.
- Next, modify this code so that it takes a file name as a command line argument, and writes its output to that file (instead of to the terminal).
- Compile and run the code again, using "output.txt" as output file (for all its output). Make sure it created that file.
To finish the assignment, below, you should submit three files:
- your modified code "getsecretword.cpp"
- the output file "output.txt"
- a text file with all the commands you need to give from the moment you are logged into the teach cluster until (and including) the command to run the modified code.
Submission is due on Thursday January 22nd, by midnight. Be mindful of the late submissions and other policies described in the syllabus.