The copy-and-swap idiom identifies that we can implement a classes copy/move assignment operators in terms of its copy/move constructor and achieve st
Continue ReadingC++: Magic Squares of Odd Order
A magic square is an square matrix whose numbers (usually integers) consist of consecutive numbers arranged so that the sum of each row and column, a
Continue ReadingC++ Full Course
[pt_view id="3a900e2db9"]
Continue ReadingC++: Black Scholes Call Option Theta
// Calculate the Black Scholes European call option Theta double BS_Call_Option_Theta(double S, double K, double r, double v, double T) // Para
Continue ReadingC++: Loop Breaks
Show a loop which prints random numbers (each number newly generated each loop) from 0 to 19 (inclusive). If a number is 10, stop the loop after print
Continue ReadingC++: Pascal’s Triangle
The task is to print out the first 15 Catalan numbers by extracting them from Pascal's triangle. This enables calculation of Catalan Numbers using onl
Continue ReadingC++: Forest Fire
Implement the Drossel and Schwabl definition of the forest-fire model. It is basically a 2D cellular automaton where each cell can be in three dist
Continue ReadingC++: Factors of an Integer
Compute the factors of a positive integer. These factors are the positive integers by which the number being factored can be divided to yield a positi
Continue ReadingC++: Bitmap
Show a basic storage type to handle a simple RGB raster graphics image, and some primitive associated functions. If possible provide a function to
Continue ReadingC++: Maze Generation
Generate and show a maze, using the simple Depth-first search algorithm. Start at a random cell. Mark the current cell as visited, and get a l
Continue Reading