Skip to main content
SciNet
  • Home
  • All Courses
  • Calendar
  • Certificates
  • SciNet
    Main Site Documentation my.SciNet
  • CCDB
  • More
Close
Toggle search input
English
English Français
You are currently using guest access
Log in
SciNet
Home All Courses Calendar Certificates SciNet Collapse Expand
Main Site Documentation my.SciNet
CCDB
Expand all Collapse all
  1. PHY1610 - Winter 2026
  2. 1: C++ on the cluster

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:

Starter code; contact us if you cannot see it.

  • 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.  


You are currently using guest access (Log in)
Data retention summary


All content on this website is made available under the Creative Commons Attribution 4.0 International licence, with the exception of all videos which are released under the Creative Commons Attribution-NoDerivatives 4.0 International licence.
Powered by Moodle