// Calculate the Black Scholes European call option Gamma double BS_Call_Option_Gamma(double S, double K, double r, double v, double T) // Para
Continue ReadingC++: Cycles in family tree software
I am the developer of some family tree software (written in C++ and Qt). I had no problems until one of my customers mailed me a bug report. The probl
Continue ReadingC++: Include a File
The task is to demonstrate the language's ability to include source code from other files. In C and C++, inclusion of other files is achieved via a
Continue ReadingC++: Function Composition
Create a function, compose, whose two arguments f and g, are both functions with one argument. The result of compose is to be a function of one argume
Continue ReadingC++: Closest-Pair Problem
The aim of this task is to provide a function to find the closest two points among a set of given points in two dimensions, i.e. to solve the Closest
Continue ReadingC++: Multiple Distinct Objects
Create a sequence (array, list, whatever) consisting of n distinct, initialized items of the same type. n should be determined at runtime. By disti
Continue ReadingC++: Compile-Time Calculation
Some programming languages allow calculation of values at compile time. For this task, calculate 10! at compile time. Print the result when the progra
Continue ReadingC++: Anonymous Recursion
While implementing a recursive function, it often happens that we must resort to a separate "helper function" to handle the actual recursion. This
Continue ReadingC++: Delegates
A delegate is a helper object used by another object. The delegator may send the delegate certain messages, and provide a default implementation when
Continue ReadingC++: Hailstone Sequence
The Hailstone sequence of numbers can be generated from a starting positive integer, n by: If n is 1 then the sequence ends. If n is even then
Continue Reading




