Stevens Institute of Technology Assignment 1
FE 522 – C++ Programming in Finance Due Date: October 13, 2020
For every problem below, create a different project folder. You should then put all these folders
inside a .zip file with your name before submitting everything in Canvas. Remember to delete the
cmake-build-debug folders before doing so. This .zip file should be accompanied by a .pdf file
containing a report (one single report for the whole assignment). We do not provide test cases fo
any of the problems, and these must be provided by you. When providing a solution to a problem,
you must be able to present test cases alongside it, otherwise it will not be accepted as a valid
solution.
If a problem requires input and/or output files, please provide the whole file content (if not large)
in the body of the report. If the file is too large to be pleasantly presented in a report (larger than a
page), please provide a sample. You should include these files in folders named "input" and "output",
espectively, in the root folder of each project. In order for your code to work on any machine (not
only yours), use relative paths to these files in your source code:
• for input files, use: "../../input/filename.txt"
• for output files, use: "../../output/filename.txt"
Problem 1 (20 points). Study the documentation in http:
en.cppreference.com/w/cpp
numeric
andom. Choose 5 different random number distributions, generate a sample of 10, 000
numbers with each of them, and create a table (output to a file) with their mean, median, and
standard deviation.
Problem 2 (20 points). Implement the following methods to find the root of a function and test
them with a polynomial function of your choice:
(a) Bisection method (https:
en.wikipedia.org/wiki/Bisection_method).
(b) Secant method (https:
en.wikipedia.org/wiki/Secant_method).
1
http:
en.cppreference.com/w/cpp/numeric
andom
http:
en.cppreference.com/w/cpp/numeric
andom
https:
en.wikipedia.org/wiki/Bisection_method
https:
en.wikipedia.org/wiki/Secant_method