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. Dashboard
  2. PHY1610 - Winter 2025
  3. Assignment 1: C++ coding

Assignment 1: C++ coding

Completion requirements
Opened: Thursday, 16 January 2025, 12:00 AM
Due: Thursday, 23 January 2025, 11:59 PM

Write a program that can take 2d data sampled at discrete time points and compute a moving average of the norm of the 2d points as a function of time.

  • The data comes from a file with 3 columns, where the first column is time `t` and the second and third columns `x(t)` and `y(t)` are 2  coordinates.
  • The program should compute the norm ($\sqrt{x^{2}+y^{2}}$), and then its moving average over `n` points. I.e. for each array element, it should compute the average of it and the preveeding `n`-1 elements. `n` will be an input parameter.
  • Perform this moving average also for the time values.  Write the result in two-column form to a file.    
  • The program should take commmand line arguments that correspond to the input file name, the output file name and the width n of the running average.

Your code should be in a simple `.cpp` file and have three or more functions in addition to the main function, and should be commented. 

Find the assignment and input file on the course website, where you can also upload 

  1. your source file and 
  2. the result file for the case `n`=5.

The assignment is due Thursday January 23rd 2025 at midnight.


  • in.dat in.dat
    16 January 2025, 10:30 AM
Contact site support
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