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++: 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++: 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++ Programming Tutorial Complete
https://www.youtube.com/watch?v=-WwGMNGRHdw
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 ReadingWhy doesn’t GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)?
I am doing some numerical optimization on a scientific application. One thing I noticed is that GCC will optimize the call pow(a,2) by compiling it in
Continue ReadingC++: Swap Containers
On lines 7–8, we create two std::vectors and initialise them with values. On line 10, we swap the contents of the two std::vectors using the std:
Continue ReadingC++: Caesar Cipher
Implement a Caesar cipher, both encoding and decoding. The key is an integer from 1 to 25. This cipher rotates (either towards left or right) the
Continue ReadingC++: 24 Game
The 24 Game tests one's mental arithmetic. Write a program that randomly chooses and displays four digits, each from one to nine, with repetitions
Continue Reading




