Create a routine that, given a set of strings representing directory paths and a single character directory separator, will return a string representi
Continue ReadingC++: Create an Object at a Given Address
In systems programing it is sometimes required to place language objects at specific memory locations, like I/O registers, hardware interrupt vectors
Continue ReadingC++: Split a string in C++
What’s the most elegant way to split a string in C++? The string can be assumed to be composed of words separated by whitespace. (Note that I’m
Continue ReadingC++: Constrained Random Points on a Circle
Generate 100 <x,y> coordinate pairs such that x and y are integers sampled from the uniform distribution with the condition that . Then display/
Continue ReadingC++: Count in Octal
The task is to produce a sequential count in octal, starting at zero, and using an increment of a one for each consecutive number. Each number should
Continue ReadingC++: Draw a Clock
Task: draw a clock. More specific: Draw a time keeping device. It can be a stopwatch, hourglass, sundial, a mouth counting "one thousand an
Continue ReadingC++: Kaprekar Numbers
A positive integer is a Kaprekar number if: It is 1 The decimal representation of its square may be split once into two parts consisting of po
Continue ReadingC++: Black Scholes Put Option Rho
// Calculate the Black Scholes European put option Rho double BS_Put_Option_Rho(double S, double K, double r, double v, double T) // Parameters
Continue ReadingC++: Foreach Loop
Loop through and print each element in a collection in order. Use your language's "for each" loop if it has one, otherwise iterate through the collect
Continue ReadingC++: Environment Variables
Show how to get one of your process's environment variables. The available variables vary by system; some of the common ones available on Unix include
Continue Reading




